How to get Access token from Linked In android sdk?

1.1k Views Asked by At

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.

2

There are 2 best solutions below

0
On
@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());
}
3
On

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