Package org.pac4j.oauth.profile.bitbucket

Examples of org.pac4j.oauth.profile.bitbucket.BitbucketProfile


        return callbackUrl;
    }

    @Override
    protected void verifyProfile(UserProfile userProfile) {
        BitbucketProfile profile = (BitbucketProfile) userProfile;
        assertEquals("testscribeup", profile.getUsername());
        assertEquals("Test", profile.getFirstName());
        assertEquals("Scribeup", profile.getFamilyName());
        assertEquals("Test Scribeup", profile.getDisplayName());
        assertFalse(profile.isTeam());
        assertEquals("https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2014/Apr/29/testscribeup-avatar-2548548378-2_avatar.png", profile.getPictureUrl());
        assertEquals("/1.0/users/testscribeup", profile.getProfileUrl());
    }
View Full Code Here


        return "https://bitbucket.org/api/1.0/user/";
    }

    @Override
    protected BitbucketProfile extractUserProfile(String body) {
        BitbucketProfile profile = new BitbucketProfile();
        JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            json = (JsonNode) JsonHelper.get(json, "user");
            if (json != null) {
                for (final String attribute : OAuthAttributesDefinitions.bitbucketDefinition.getAllAttributes()) {
                   profile.addAttribute(attribute, JsonHelper.get(json, attribute));
                }
            }
        }
       return profile;
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.bitbucket.BitbucketProfile

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.