Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from jorcasso/linked_in_modification
Browse files Browse the repository at this point in the history
Linked in modification
  • Loading branch information
jolivares committed Mar 11, 2015
2 parents 4aec0e8 + 916c9ff commit b2285e6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>();
domainMap.put(Constants.GOOGLE, "www.google.com");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String, String> UPDATE_TYPES;
private final Log LOG = LogFactory.getLog(this.getClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 [email protected]
*
*/

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 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><share><comment>%1$s</comment><visibility><code>anyone</code></visibility></share>";
private static final Map<String, String> ENDPOINTS;
private final Log LOG = LogFactory.getLog(LinkedInImpl.class);
private final Log LOG = LogFactory.getLog(LinkedInOAuth2Impl.class);

private Permission scope;
private AccessGrant accessToken;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -462,8 +463,8 @@ public Response uploadImage(final String message, final String fileName,
@Override
protected List<String> getPluginsList() {
List<String> list = new ArrayList<String>();
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()));
Expand All @@ -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<String> 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit b2285e6

Please sign in to comment.