Package org.apache.geronimo.security

Examples of org.apache.geronimo.security.RealmPrincipal


                Iterator principals = realm.getPrincipals().iterator();
                while (principals.hasNext()) {
                    Principal principal = (Principal) principals.next();

                    RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal, realm.getRealmName());

                    if (realmPrincipal == null) throw new DeploymentException("Unable to create realm principal");

                    principalSet.add(realmPrincipal);
                    if (principal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(realmPrincipal);
View Full Code Here


                Iterator principals = realm.getPrincipals().iterator();
                while (principals.hasNext()) {
                    Principal principal = (Principal) principals.next();

                    RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal, realm.getRealmName());

                    if (realmPrincipal == null) throw new DeploymentException("Unable to create realm principal");

                    principalSet.add(realmPrincipal);
                    if (principal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(realmPrincipal);
View Full Code Here

    }

    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final String className, final String principalName,
                                                        ClassLoader classLoader)
    {
        return new RealmPrincipal(realm, loginDomain, generatePrincipal(className, principalName, classLoader));
    }
View Full Code Here

            assertTrue("id of server-side subject should be non-null", ContextManager.getSubjectId(subject) != null);
            assertEquals("server-side subject should have three principals", 3, subject.getPrincipals().size());
            assertEquals("server-side subject should have one realm principal", 1, subject.getPrincipals(RealmPrincipal.class).size());
            assertEquals("server-side subject should have one identification principal", 1, subject.getPrincipals(IdentificationPrincipal.class).size());
            assertEquals("server-side subject should have one kerberos principal", 1, subject.getPrincipals(KerberosPrincipal.class).size());
            RealmPrincipal principal = (RealmPrincipal) subject.getPrincipals(RealmPrincipal.class).iterator().next();

            context.logout();

            assertTrue("id of subject should be null", ContextManager.getSubjectId(subject) == null);
        } catch (LoginException e) {
View Full Code Here

        Set wrapped = new HashSet();
        for (Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) {
            Principal principal = (Principal) iter.next();

            wrapped.add(new DomainPrincipal(loginDomainName, principal));
            wrapped.add(new RealmPrincipal(realmName, loginDomainName, principal));
        }
        localSubject.getPrincipals().addAll(wrapped);
        subject.getPrincipals().addAll(localSubject.getPrincipals());

        return result;
View Full Code Here

        Set wrapped = new HashSet();
        for (Iterator iter = localSubject.getPrincipals().iterator(); iter.hasNext();) {
            Principal principal = (Principal) iter.next();

            wrapped.add(new DomainPrincipal(loginDomainName, principal));
            wrapped.add(new RealmPrincipal(realmName, loginDomainName, principal));
        }
        localSubject.getPrincipals().addAll(wrapped);
        subject.getPrincipals().addAll(localSubject.getPrincipals());

        return result;
View Full Code Here

    }

    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final String className, final String principalName,
                                                        ClassLoader classLoader)
    {
        return new RealmPrincipal(realm, loginDomain, generatePrincipal(className, principalName, classLoader));
    }
View Full Code Here

        if (subject == null) {
//            Set principals = Collections.EMPTY_SET;
        } else if (realm != null) {
            Set principals = subject.getPrincipals(RealmPrincipal.class);
            for (Iterator iter = principals.iterator(); iter.hasNext();) {
                RealmPrincipal p = (RealmPrincipal) iter.next();
                if (p.getRealm().equals(realm) && p.getLoginDomain().equals(domain) && p.getPrincipal().getClass().equals(principalClass)) {
                    principalName = p.getPrincipal().getName();
                    if (p instanceof PrimaryRealmPrincipal) break;
                }
            }
        } else if (domain != null) {
            Set principals = subject.getPrincipals(DomainPrincipal.class);
            for (Iterator iter = principals.iterator(); iter.hasNext();) {
                DomainPrincipal p = (DomainPrincipal) iter.next();
                if (p.getDomain().equals(domain) && p.getPrincipal().getClass().equals(principalClass)) {
                    principalName = p.getPrincipal().getName();
                    if (p instanceof PrimaryDomainPrincipal) break;
                }
            }
        } else {
            Set principals = subject.getPrincipals(principalClass);
View Full Code Here

        if (realm.length() == 0 || domain.length() == 0 || className.length() == 0 || principalName.length() == 0) {
            throw new GeronimoSecurityException("Unable to create primary realm principal");
        }

        RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(realm, domain, className, principalName, classLoader);
        if (realmPrincipal == null) {
            throw new GeronimoSecurityException("Unable to create realm principal");
        }
        PrimaryRealmPrincipal primaryRealmPrincipal = null;
        try {
View Full Code Here

    }

    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final String className, final String principalName,
                                                        ClassLoader classLoader)
    {
        return new RealmPrincipal(realm, loginDomain, generatePrincipal(className, principalName, classLoader));
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.RealmPrincipal

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.