Examples of addAttribute()


Examples of org.pac4j.oauth.profile.google2.Google2Profile.addAttribute()

        final Google2Profile profile = new Google2Profile();
        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            profile.setId(JsonHelper.get(json, "id"));
            for (final String attribute : OAuthAttributesDefinitions.google2Definition.getPrincipalAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }

Examples of org.pac4j.oauth.profile.linkedin.LinkedInProfile.addAttribute()

    @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);
            }
        }

Examples of org.pac4j.oauth.profile.linkedin2.LinkedIn2Profile.addAttribute()

    @Override
    protected LinkedIn2Profile extractUserProfile(final String body) {
        LinkedIn2Profile profile = new LinkedIn2Profile();
        profile.setId(XmlHelper.get(body, "id"));
        for (final String attribute : OAuthAttributesDefinitions.linkedin2Definition.getPrincipalAttributes()) {
            profile.addAttribute(attribute, XmlHelper.get(body, attribute));
        }
        String url = XmlHelper.get(XmlHelper.get(body, LinkedIn2AttributesDefinition.SITE_STANDARD_PROFILE_REQUEST),
                                   "url");
        profile.addAttribute(LinkedIn2AttributesDefinition.SITE_STANDARD_PROFILE_REQUEST, url);
        return profile;

Examples of org.pac4j.oauth.profile.orcid.OrcidProfile.addAttribute()

    @Override
    protected OrcidProfile extractUserProfile(String body) {
        OrcidProfile profile = new OrcidProfile();
        for(final String attribute : OAuthAttributesDefinitions.orcidDefinition.getAllAttributes()) {
            profile.addAttribute(attribute, XmlHelper.get(body, attribute));
        }
        return profile;
    }

    @Override

Examples of org.pac4j.oauth.profile.paypal.PayPalProfile.addAttribute()

        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            final String userId = (String) JsonHelper.get(json, "user_id");
            profile.setId(StringUtils.substringAfter(userId, "/user/"));
            for (final String attribute : OAuthAttributesDefinitions.payPalDefinition.getAllAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }
   

Examples of org.pac4j.oauth.profile.twitter.TwitterProfile.addAttribute()

        final TwitterProfile profile = new TwitterProfile();
        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            profile.setId(JsonHelper.get(json, "id"));
            for (final String attribute : OAuthAttributesDefinitions.twitterDefinition.getAllAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }
   

Examples of org.pac4j.oauth.profile.vk.VkProfile.addAttribute()

    if (json != null) {
      ArrayNode array = (ArrayNode) json.get("response");
      JsonNode userNode = array.get(0);
      profile.setId(JsonHelper.get(userNode, "uid"));
      for (final String attribute : OAuthAttributesDefinitions.vkDefinition.getAllAttributes()) {
        profile.addAttribute(attribute, JsonHelper.get(userNode, attribute));
      }
    }
    return profile;
  }

Examples of org.pac4j.oauth.profile.windowslive.WindowsLiveProfile.addAttribute()

        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;
    }
   

Examples of org.pac4j.oauth.profile.wordpress.WordPressProfile.addAttribute()

        final WordPressProfile profile = new WordPressProfile();
        JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            profile.setId(JsonHelper.get(json, "ID"));
            for (final String attribute : OAuthAttributesDefinitions.wordPressDefinition.getPrincipalAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
            json = json.get("meta");
            if (json != null) {
                final String attribute = WordPressAttributesDefinition.LINKS;
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));

Examples of org.pac4j.oauth.profile.yahoo.YahooProfile.addAttribute()

        if (json != null) {
            json = json.get("profile");
            if (json != null) {
                profile.setId(JsonHelper.get(json, "guid"));
                for (final String attribute : OAuthAttributesDefinitions.yahooDefinition.getAllAttributes()) {
                    profile.addAttribute(attribute, JsonHelper.get(json, attribute));
                }
            }
        }
        return profile;
    }
TOP
Copyright © 2018 www.massapi.com. 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.