diff --git a/socialauth/src/main/java/org/brickred/socialauth/SocialAuthConfig.java b/socialauth/src/main/java/org/brickred/socialauth/SocialAuthConfig.java index e5b1cb1..584fbef 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/SocialAuthConfig.java +++ b/socialauth/src/main/java/org/brickred/socialauth/SocialAuthConfig.java @@ -116,7 +116,7 @@ public SocialAuthConfig() { providersImplMap.put(Constants.NIMBLE, org.brickred.socialauth.provider.NimbleImpl.class); providersImplMap.put(Constants.LINKEDINOAUTH2, - org.brickred.socialauth.provider.LinkedInAuth2Impl.class); + org.brickred.socialauth.provider.LinkedInOAuth2Impl.class); domainMap = new HashMap(); domainMap.put(Constants.GOOGLE, "www.google.com"); diff --git a/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/CareerPluginImpl.java b/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/CareerPluginImpl.java similarity index 97% rename from socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/CareerPluginImpl.java rename to socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/CareerPluginImpl.java index a6af26a..44ec072 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/CareerPluginImpl.java +++ b/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/CareerPluginImpl.java @@ -22,7 +22,7 @@ of this software and associated documentation files (the "Software"), to deal =========================================================================== */ -package org.brickred.socialauth.plugin.linkedinAuth2; +package org.brickred.socialauth.plugin.linkedin.oauth2; import java.io.Serializable; @@ -43,19 +43,18 @@ of this software and associated documentation files (the "Software"), to deal import org.w3c.dom.NodeList; /** - * Career plugin implementation for linkedin + * Career plugin implementation for LinkedIn OAuth2 provider * * @author tarun.nagpal * */ public class CareerPluginImpl implements CareerPlugin, Serializable { - private static final long serialVersionUID = -1733773634998485298L; - + private static final long serialVersionUID = 3296673276334272488L; private ProviderSupport providerSupport; private final Log LOG = LogFactory.getLog(this.getClass()); - private static final String PROFILE_URL = "https://api.linkedin.com/v1/people/~:(id,phone-numbers,headline,educations,positions,recommendations-received)?oauth2_access_token"; + private static final String PROFILE_URL = "https://api.linkedin.com/v1/people/~:(id,phone-numbers,headline,educations,positions,recommendations-received)?oauth2_access_token="; public CareerPluginImpl(final ProviderSupport providerSupport) { this.providerSupport = providerSupport; diff --git a/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/FeedPluginImpl.java b/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/FeedPluginImpl.java similarity index 98% rename from socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/FeedPluginImpl.java rename to socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/FeedPluginImpl.java index 351acfd..0a3ef1e 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedinAuth2/FeedPluginImpl.java +++ b/socialauth/src/main/java/org/brickred/socialauth/plugin/linkedin/oauth2/FeedPluginImpl.java @@ -22,7 +22,7 @@ of this software and associated documentation files (the "Software"), to deal =========================================================================== */ -package org.brickred.socialauth.plugin.linkedinAuth2; +package org.brickred.socialauth.plugin.linkedin.oauth2; import java.io.Serializable; import java.util.ArrayList; @@ -48,15 +48,15 @@ of this software and associated documentation files (the "Software"), to deal import org.w3c.dom.NodeList; /** - * Feed Plugin implementation for Linkedin + * Feed Plugin implementation for LinkedIn OAuth2 Provider * * @author tarun.nagpal * */ public class FeedPluginImpl implements FeedPlugin, Serializable { - private static final long serialVersionUID = 497690659988355485L; - private static final String FEED_URL = "https://api.linkedin.com/v1/people/~/network/updates?oauth2_access_token"; + private static final long serialVersionUID = -5703250073492118123L; + private static final String FEED_URL = "https://api.linkedin.com/v1/people/~/network/updates?oauth2_access_token="; private static final Map UPDATE_TYPES; private final Log LOG = LogFactory.getLog(this.getClass()); diff --git a/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInImpl.java b/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInImpl.java index a3ca08e..b092c7a 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInImpl.java +++ b/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInImpl.java @@ -54,7 +54,7 @@ of this software and associated documentation files (the "Software"), to deal import org.w3c.dom.NodeList; /** - * Implementation of Linkedin provider. This uses the oAuth API provided by + * Implementation of LinkedIn provider. This uses the OAuth API provided by * Linkedin * * diff --git a/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInAuth2Impl.java b/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInOAuth2Impl.java similarity index 95% rename from socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInAuth2Impl.java rename to socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInOAuth2Impl.java index adabe9a..d65631d 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInAuth2Impl.java +++ b/socialauth/src/main/java/org/brickred/socialauth/provider/LinkedInOAuth2Impl.java @@ -1,6 +1,6 @@ /* =========================================================================== - Copyright (c) 2010 BrickRed Technologies Limited + Copyright (c) 2014 BrickRed Technologies Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -54,23 +54,23 @@ of this software and associated documentation files (the "Software"), to deal import org.w3c.dom.NodeList; /** - * Implementation of Linkedin oAuth2 provider. This uses the oAuth API provided - * by Linkedin + * Implementation of LinkedIn OAuth2 provider. This uses the OAuth2 API provided + * by LinkedIn * * * @author vineet.aggarwal@3pillarglobal.com * */ -public class LinkedInAuth2Impl extends AbstractProvider { +public class LinkedInOAuth2Impl extends AbstractProvider { - private static final long serialVersionUID = -6141448721085510813L; + private static final long serialVersionUID = 3389564715902769183L; private static final String CONNECTION_URL = "https://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,public-profile-url,picture-url)?oauth2_access_token="; private static final String UPDATE_STATUS_URL = "https://api.linkedin.com/v1/people/~/shares?oauth2_access_token="; private static final String PROFILE_URL = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,languages,date-of-birth,picture-url,email-address,location:(name),phone-numbers,main-address)?oauth2_access_token="; private static final String STATUS_BODY = "%1$sanyone"; private static final Map ENDPOINTS; - private final Log LOG = LogFactory.getLog(LinkedInImpl.class); + private final Log LOG = LogFactory.getLog(LinkedInOAuth2Impl.class); private Permission scope; private AccessGrant accessToken; @@ -100,7 +100,8 @@ public class LinkedInAuth2Impl extends AbstractProvider { * and consumer secret * @throws Exception */ - public LinkedInAuth2Impl(final OAuthConfig providerConfig) throws Exception { + public LinkedInOAuth2Impl(final OAuthConfig providerConfig) + throws Exception { config = providerConfig; // Need to pass scope while fetching RequestToken from LinkedIn for new // keys @@ -462,8 +463,8 @@ public Response uploadImage(final String message, final String fileName, @Override protected List getPluginsList() { List list = new ArrayList(); - list.add("org.brickred.socialauth.plugin.linkedinAuth2.FeedPluginImpl"); - list.add("org.brickred.socialauth.plugin.linkedinAuth2.CareerPluginImpl"); + list.add("org.brickred.socialauth.plugin.linkedin.oauth2.FeedPluginImpl"); + list.add("org.brickred.socialauth.plugin.linkedin.oauth2.CareerPluginImpl"); if (config.getRegisteredPlugins() != null && config.getRegisteredPlugins().length > 0) { list.addAll(Arrays.asList(config.getRegisteredPlugins())); @@ -489,15 +490,15 @@ private String getScope() { } result.append(arr[0]); for (int i = 1; i < arr.length; i++) { - result.append(" ").append(arr[i]); + result.append("+").append(arr[i]); } List scopes = config.getPluginsScopes(); if (scopes != null && !scopes.isEmpty()) { String scopesStr = scopes.get(0); for (int i = 1; i < scopes.size(); i++) { - scopesStr += " " + scopes.get(i); + scopesStr += "+" + scopes.get(i); } - result.append(" ").append(scopesStr); + result.append("+").append(scopesStr); } return result.toString(); } diff --git a/socialauth/src/main/java/org/brickred/socialauth/util/Constants.java b/socialauth/src/main/java/org/brickred/socialauth/util/Constants.java index e197603..36c0194 100644 --- a/socialauth/src/main/java/org/brickred/socialauth/util/Constants.java +++ b/socialauth/src/main/java/org/brickred/socialauth/util/Constants.java @@ -208,7 +208,7 @@ public interface Constants { public static final String NIMBLE = "nimble"; /** - * linkedin oAuth2.0 provider + * linkedin OAuth2 provider */ public static final String LINKEDINOAUTH2 = "linkedin2";