Package org.apache.geronimo.security.realm.providers

Examples of org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal


        return true;
    }

    public boolean commit() throws LoginException {
        Set principals = subject.getPrincipals();
        principals.add(new GeronimoUserPrincipal(cbUsername));
        Iterator iter = groups.iterator();
        while (iter.hasNext()) {
            principals.add(iter.next());
        }
        return true;
View Full Code Here


*/
public class ContextManagerTest extends TestCase {

    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
View Full Code Here

    }

    public boolean commit() throws LoginException {
        Set principals = subject.getPrincipals();

        principals.add(new GeronimoUserPrincipal(username));

        Iterator e = groups.keySet().iterator();
        while (e.hasNext()) {
            String groupName = (String) e.next();
            Set users = (Set) groups.get(groupName);
View Full Code Here

        }
        throw new LoginException();
    }

    public boolean commit() throws LoginException {
        Principal principal = new GeronimoUserPrincipal(user);
        subject.getPrincipals().add(principal);
        return true;
    }
View Full Code Here

*/
public class ContextManagerTest extends TestCase {

    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
View Full Code Here

        return true;
    }

    public boolean commit() throws LoginException {
        Set principals = subject.getPrincipals();
        principals.add(new GeronimoUserPrincipal(cbUsername));
        Iterator iter = groups.iterator();
        while (iter.hasNext()) {
            principals.add(iter.next());
        }
        return true;
View Full Code Here

//            final ServletCallbackHandler callbackHandler = new ServletCallbackHandler(loginService);
            final Subject subject = new Subject();
            final AccessControlContext acc = ContextManager.registerSubjectShort(subject, null, null);
            securityHandlerFactory = new ServerAuthenticationGBean(new Authenticator() {
                public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean mandatory) throws ServerAuthException {
                    return new UserAuthentication(this.getAuthMethod(), new GeronimoUserIdentity(subject, new GeronimoUserPrincipal("foo"), acc));
                }// most likely validatedUser is not needed here.

                public boolean secureResponse(ServletRequest request, ServletResponse response, boolean mandatory, Authentication.User validatedUser) throws ServerAuthException {
                    return true;
                }
View Full Code Here

        }

        public UserIdentity login(String userName, Object credentials) {
            String pws = users.get(userName);
            if (pws != null && pws.equals(credentials)) {
                final GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal(userName);
                Subject subject = new Subject();
                subject.getPrincipals().add(userPrincipal);
                List<String> usersGroups = groups.get(userName);
                if (usersGroups != null) {
                    for (String group: usersGroups) {
View Full Code Here

*/
public class ContextManagerTest extends TestCase {

    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
View Full Code Here

*/
public class ContextManagerTest extends TestCase {

    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal

Copyright © 2018 www.massapicom. 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.