

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of ejb 3.0 security, focusing on authentication, authorization, and confidentiality protection in java enterprise edition. The concepts of authentication and identity, authorization, and security configuration using jndi and database services.
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


2007-4-3 © Dr. Ye Wu 2
2007-4-3 © Dr. Ye Wu 3
2007-4-3 © Dr. Ye Wu 4
properties.setPropertyproperties.setProperty(( Context.Context. INITIAL_CONTEXT_FACTORYINITIAL_CONTEXT_FACTORY ,, "" org.jboss.security.jndi.JndiLoginInitialContextFactoryorg.jboss.security.jndi.JndiLoginInitialContextFactory ");"); properties.putproperties.put(( Context.Context. URL_PKG_PREFIXESURL_PKG_PREFIXES ,, ""org.jboss.naming:org.jnp.interfacesorg.jboss.naming:org.jnp.interfaces");"); properties.put(Context.properties.put(Context. PROVIDER_URLPROVIDER_URL ,, "jnp://localhost:1099");"jnp://localhost:1099"); properties.setPropertyproperties.setProperty(( Context.Context. SECURITY_PRINCIPALSECURITY_PRINCIPAL ,, "admin");"admin"); properties.setPropertyproperties.setProperty(( Context.Context. SECURITY_CREDENTIALSSECURITY_CREDENTIALS , "password");, "password");
2007-4-3 © Dr. Ye Wu 5
2007-4-3 © Dr. Ye Wu 6
import org.jboss.annotation.security.SecurityDomain; import javax.annotation.security.PermitAll; import javax.annotation.security.RolesAllowed;
@Stateless @SecurityDomain("other") public class StatelessEJB implements StatelessRemote { @PermitAll public void addFunds(double amount) {… …}
@RolesAllowed( { "admin" }) public void withdrawFunds(double amount) throws InsufficientBalanceException {… …} }
2007-4-3 © Dr. Ye Wu 7
2007-4-3 © Dr. Ye Wu 8
2007-4-3 © Dr. Ye Wu 9
<application-policy name="testLDAP">
2007-4-3 © Dr. Ye Wu 10