

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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