Examples of IdentificationPrincipal


Examples of org.apache.geronimo.security.IdentificationPrincipal

         * Register our default principal with the ContextManager
         */
        Subject defaultSubject = this.defaultPrincipal.getSubject();
        ContextManager.registerSubject(defaultSubject);
        SubjectId id = ContextManager.getSubjectId(defaultSubject);
        defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));
        this.realm = realm;
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

                DefaultPrincipal defaultPrincipal = securityHolder.getDefaultPrincipal();
                if (defaultPrincipal != null) {
                    defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getClassLoader());
                    ContextManager.registerSubject(defaultSubject);
                    SubjectId id = ContextManager.getSubjectId(defaultSubject);
                    defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));
                }

                interceptor = new PolicyContextBeforeAfter(interceptor, index++, securityHolder.getPolicyContextID());
            }
        }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

        for (Iterator iterator = roleDesignates.entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            Subject roleDesignate = (Subject) entry.getValue();
            ContextManager.registerSubject(roleDesignate);
            SubjectId id = ContextManager.getSubjectId(roleDesignate);
            roleDesignate.getPrincipals().add(new IdentificationPrincipal(id));
        }
        this.roleDesignates = roleDesignates;
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

                }

                defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getClassLoader());
                ContextManager.registerSubject(defaultSubject);
                SubjectId id = ContextManager.getSubjectId(defaultSubject);
                defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));

                interceptor = new PolicyContextBeforeAfter(interceptor, index++, index++, index++, securityHolder.getPolicyContextID(), defaultSubject);

            }
        }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

         * Register our default principal with the ContextManager
         */
        Subject defaultSubject = this.defaultPrincipal.getSubject();
        ContextManager.registerSubject(defaultSubject);
        SubjectId id = ContextManager.getSubjectId(defaultSubject);
        defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));
        this.realm = (JAASJettyRealm)getUserRealm();
        assert realm != null;
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

        Set<IdentificationPrincipal> identificationPrincipals = subject.getPrincipals(IdentificationPrincipal.class);
        if (identificationPrincipals.isEmpty()) {
            return null;
        }

        IdentificationPrincipal principal = identificationPrincipals.iterator().next();
        return principal.getId();
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

        }

        Subject subject = session.getSubject();
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        IdentificationPrincipal principal = new IdentificationPrincipal(id);
        subject.getPrincipals().add(principal);
        return principal;
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

                }

                defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getClassLoader());
                ContextManager.registerSubject(defaultSubject);
                SubjectId id = ContextManager.getSubjectId(defaultSubject);
                defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));

                interceptor = new PolicyContextBeforeAfter(interceptor, index++, index++, index++, securityHolder.getPolicyContextID(), defaultSubject);

            }
        }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

    }

    private void registerSubject(Subject subject) {
        ContextManager.registerSubject(subject);
        SubjectId id = ContextManager.getSubjectId(subject);
        subject.getPrincipals().add(new IdentificationPrincipal(id));
    }
View Full Code Here

Examples of org.apache.geronimo.security.IdentificationPrincipal

        Subject subject = context.getSubject();
        assertTrue("expected non-null client subject", subject != null);
        Set set = subject.getPrincipals(IdentificationPrincipal.class);
        assertEquals("client subject should have one ID principal", set.size(), 1);
        IdentificationPrincipal idp = (IdentificationPrincipal) set.iterator().next();
        subject = ContextManager.getRegisteredSubject(idp.getId());

        assertTrue("expected non-null server subject", subject != null);
        assertTrue("server subject should have one remote principal", subject.getPrincipals(IdentificationPrincipal.class).size() == 1);
        IdentificationPrincipal remote = subject.getPrincipals(IdentificationPrincipal.class).iterator().next();
        assertTrue("server subject should be associated with remote id", ContextManager.getRegisteredSubject(remote.getId()) != null);
        assertEquals("server-side subject should have seven principal", 7, subject.getPrincipals().size());
        assertTrue("server subject should have two realm principal", subject.getPrincipals(RealmPrincipal.class).size() == 2);
        assertTrue("server subject should have two domain principal", subject.getPrincipals(DomainPrincipal.class).size() == 2);

        assertTrue("id of server subject should be non-null", ContextManager.getSubjectId(subject) != null);
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.