Package org.pac4j.oauth.profile.linkedin

Examples of org.pac4j.oauth.profile.linkedin.LinkedInProfile


        kryo.register(LinkedInProfile.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final LinkedInProfile profile = (LinkedInProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals("167439971", profile.getId());
        assertEquals(LinkedInProfile.class.getSimpleName() + UserProfile.SEPARATOR + "167439971", profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), LinkedInProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile,
                            null,
                            "test",
                            "scribeUp",
                            "test scribeUp",
                            null,
                            Gender.UNSPECIFIED,
                            null,
                            null,
                            "http://www.linkedin.com/profile/view?id=167439971&authType=name&authToken=_IWF&trk=api*",
                            null);
        assertEquals("ScribeUP développeur chez OpenSource", profile.getHeadline());
        assertNotNull(profile.getAccessSecret());
        assertEquals(6, profile.getAttributes().size());
    }
View Full Code Here


        }
    }
   
    @Override
    protected LinkedInProfile extractUserProfile(final String body) {
        final LinkedInProfile profile = new LinkedInProfile();
        for (final String attribute : OAuthAttributesDefinitions.linkedinDefinition.getAllAttributes()) {
            final String value = StringUtils.substringBetween(body, "<" + attribute + ">", "</" + attribute + ">");
            profile.addAttribute(attribute, value);
            if (LinkedInAttributesDefinition.URL.equals(attribute)) {
                final String id = StringUtils.substringBetween(value, "id=", "&amp;authType=");
                profile.setId(id);
            }
        }
        return profile;
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.linkedin.LinkedInProfile

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.