0

I have given social authentication via Linked In. I have successfully integrated the mobile sdk into my project. Now the question is, how to get access token.

I didn't find any way to fetch access token from sdk.

Please help me.

Rohan Patel
  • 1,758
  • 2
  • 21
  • 38

2 Answers2

2
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // Add this line to your existing onActivityResult() method
    LISessionManager.getInstance(getApplicationContext()).onActivityResult(this, requestCode, resultCode, data);
    Log.i("Access token->", LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken().getValue());
}
Rohan Patel
  • 1,758
  • 2
  • 21
  • 38
1

You can achieve it by calling webview intent for authorization and then on response you can retrieve it in your activity. Just follow the steps:

https://stackoverflow.com/a/12405429/5577679

Community
  • 1
  • 1
tompadre
  • 797
  • 7
  • 22
  • Answer was asked in 2011. Its too old. Now we have LinkedIn sdk. Why should i go witth webview? – Rohan Patel May 12 '17 at 10:31
  • Have you tried this? http://stackoverflow.com/questions/30080583/android-linkedin-sdk-produces-unusable-access-tokens?rq=1 – tompadre May 12 '17 at 10:42
  • LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken().getValue() helps to get access token. Note: add above line in onActivityResult(). – Rohan Patel May 12 '17 at 11:08