Package org.pac4j.cas.profile

Examples of org.pac4j.cas.profile.CasProfile


        kryo.register(CasProfile.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final CasProfile profile = (CasProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals(USERNAME, profile.getId());
        assertEquals(CasProfile.class.getSimpleName() + UserProfile.SEPARATOR + USERNAME, profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), CasProfile.class));
        if (getCasProtocol() == CasProtocol.SAML) {
            assertEquals("uid", profile.getAttribute("uid"));
            assertEquals("eduPersonAffiliation", profile.getAttribute("eduPersonAffiliation"));
            assertEquals("groupMembership", profile.getAttribute("groupMembership"));
            assertEquals(3, profile.getAttributes().size());
        } else {
            assertEquals(0, profile.getAttributes().size());
        }
    }
View Full Code Here


        try {
            final String contextualCallbackUrl = getContextualCallbackUrl(context);
            final Assertion assertion = this.ticketValidator.validate(ticket, contextualCallbackUrl);
            final AttributePrincipal principal = assertion.getPrincipal();
            logger.debug("principal : {}", principal);
            final CasProfile casProfile;
            if (this.casProxyReceptor != null) {
                casProfile = new CasProxyProfile();
            } else {
                casProfile = new CasProfile();
            }
            casProfile.setId(principal.getName());
            casProfile.addAttributes(principal.getAttributes());
            if (this.casProxyReceptor != null) {
                ((CasProxyProfile) casProfile).setPrincipal(principal);
            }
            logger.debug("casProfile : {}", casProfile);
            return casProfile;
View Full Code Here

TOP

Related Classes of org.pac4j.cas.profile.CasProfile

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.