Examples of RunAsSession


Examples of org.jboss.test.security.ejb3.RunAsSession

      // login with a user that has the RegularUser role.
      this.login("UserB", "PassB".toCharArray());

      // get a reference to the remote run-as session.
      Object obj = getInitialContext().lookup("RunAsSessionBean/remote");
      RunAsSession session = (RunAsSession) PortableRemoteObject.narrow(obj, RunAsSession.class);

      // invoke the session, that delegates the invocation to the delegate session using @RunAs.
      Principal principal = session.invokeRunAs();
      assertNotNull("Found unexpected null principal", principal);
      // run-as identity should be the default unauthenticated identity configured in the login module.
      assertEquals("anonymous", principal.getName());

      this.logout();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.