-2

I am currently working the social login modules using LinkedIn. The official documentation says the old method using OAuth 1.0 becomes obsolete since 12 Jan 2019.

Would you please tell me what would the request call to be changed if using O Auth 2.0 and mentioned in the microsoft doc ?

Below is my login method:

void startAutheniticate() {
    LISessionManager.getInstance(getApplicationContext()).init(this,
            buildScope(),
            new AuthListener() {
                @Override
                public void onAuthSuccess() {
                    // Saved AccessToken
                    AccessToken accessToken = LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken();
                }

                @Override
                public void onAuthError(LIAuthError error) {

                }
            }, true);
}

public static Scope buildScope() {
    return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS, Scope.W_SHARE);
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    LISessionManager.getInstance(getApplicationContext()).onActivityResult(this, requestCode, resultCode, data);
}

https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context

Muhammad Muzammil
  • 1,313
  • 1
  • 12
  • 28
Jeff Bootsholz
  • 2,971
  • 15
  • 70
  • 141
  • 1
    Possible duplicate of [Can not get access token from LinkedIn app. It is returning null in onActivityResult](https://stackoverflow.com/questions/54182781/can-not-get-access-token-from-linkedin-app-it-is-returning-null-in-onactivityre) – Muhammad Muzammil Jan 17 '19 at 09:28

1 Answers1

0

They have deprecated the v1 implementation but haven't yet updated their LinkedIn app (nor SDK) on Android, so the only solution available is to use their JavaScript API to authenticate your applications via v2 implementation. Plus they said that developers had time until March 1, 2019 but for some reason their Android application is now returning a null token (starting from January 14, 2019) if you try to use the LinkedIn SDK to authenticate your app

Muhammad Muzammil
  • 1,313
  • 1
  • 12
  • 28
  • https://developer.linkedin.com/docs/getting-started-js-sdk Also says the javascript API is not supported. That means we have to wait for their development too ? – Jeff Bootsholz Jan 17 '19 at 08:34
  • Actually you are viewing the documentation of the deprecated v1 apis. Read [this](https://engineering.linkedin.com/blog/2018/12/developer-program-updates) Or [this](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq) – Muhammad Muzammil Jan 17 '19 at 08:37
  • I follow the guidelines to get access token from LinkedIn. It finds Something wrong without any messages. https://stackoverflow.com/questions/32076503/using-postman-to-access-oauth-2-0-google-apis – Jeff Bootsholz Jan 17 '19 at 08:45
  • Please follow their [official documentation](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context). Sign In with LinkedIn is a two step process. You first request an authorize code by specifying scopes and then exchange that authorize code from access token. – Muhammad Muzammil Jan 17 '19 at 09:28