Package org.pac4j.oauth.profile.casoauthwrapper

Examples of org.pac4j.oauth.profile.casoauthwrapper.CasOAuthWrapperProfile


        kryo.register(CasOAuthWrapperProfile.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final CasOAuthWrapperProfile profile = (CasOAuthWrapperProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals(USERNAME, profile.getId());
        assertEquals(CasOAuthWrapperProfile.class.getSimpleName() + UserProfile.SEPARATOR + USERNAME,
                     profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), CasOAuthWrapperProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertEquals("uid", profile.getAttribute("uid"));
        assertEquals("eduPersonAffiliation", profile.getAttribute("eduPersonAffiliation"));
        assertEquals("groupMembership", profile.getAttribute("groupMembership"));
        assertEquals(4, profile.getAttributes().size());
    }
View Full Code Here


        return this.casOAuthUrl + "/profile";
    }
   
    @Override
    protected CasOAuthWrapperProfile extractUserProfile(final String body) {
        final CasOAuthWrapperProfile userProfile = new CasOAuthWrapperProfile();
        JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            userProfile.setId(JsonHelper.get(json, "id"));
            json = json.get("attributes");
            if (json != null) {
                final Iterator<JsonNode> nodes = json.iterator();
                while (nodes.hasNext()) {
                    json = nodes.next();
                    final String attribute = json.fieldNames().next();
                    userProfile.addAttribute(attribute, JsonHelper.get(json, attribute));
                }
            }
        }
        return userProfile;
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.casoauthwrapper.CasOAuthWrapperProfile

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.