Package org.pac4j.oauth.profile.windowslive

Examples of org.pac4j.oauth.profile.windowslive.WindowsLiveProfile


        return "https://apis.live.net/v5.0/me";
    }
   
    @Override
    protected WindowsLiveProfile extractUserProfile(final String body) {
        final WindowsLiveProfile profile = new WindowsLiveProfile();
        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            profile.setId(JsonHelper.get(json, "id"));
            for (final String attribute : OAuthAttributesDefinitions.windowsLiveDefinition.getAllAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }
View Full Code Here


        kryo.register(WindowsLiveProfile.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final WindowsLiveProfile profile = (WindowsLiveProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals("416c383b220392d8", profile.getId());
        assertEquals(WindowsLiveProfile.class.getSimpleName() + UserProfile.SEPARATOR + "416c383b220392d8",
                     profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), WindowsLiveProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile, null, "Test", "ScribeUP", "Test ScribeUP", null, Gender.UNSPECIFIED,
                            Locale.FRANCE, null, "https://profile.live.com/", null);
        assertNotNull(profile.getUpdatedTime());
        assertEquals(7, profile.getAttributes().size());
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.windowslive.WindowsLiveProfile

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.