Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

The token used in the request has been revoked by the user #461

Open
differenz-Team opened this issue Feb 3, 2022 · 1 comment
Open

Comments

@differenz-Team
Copy link

Xamarin.Auth Issue

I have implemented LinkedIn login using OAuth2Authenticator in Xamarin. But for the last few days, it is not working on the Andriod device.

I am got the error "service Error Code":65601,"message":"The token used in the request has been revoked by the user" while I try to LinkedIn from an Android device.

Here, is the code where I got the error access token revoked by the user.
IF BUG, INCLUDE THIS PART:

nuget version = Xamarin.Auth (1.7.0)

Steps to reproduce

  1. I call this on LinkedIn login button click.
    var auth = new OAuth2Authenticator(
    clientId: Keys.LinkedInClientId,
    clientSecret: Keys.LinkedInClientSecret,
    scope: ConfigService.Environment.LinkedInScope,
    authorizeUrl: new Uri("https://www.linkedin.com/oauth/v2/authorization"),
    redirectUrl: new Uri(ConfigService.Environment.LinkedInRedirectUrl),
    accessTokenUrl: new Uri("https://www.linkedin.com/oauth/v2/accessToken"))
    {
    AllowCancel = true,
    ShowErrors = false,
    ClearCookiesBeforeLogin = true,
    IsLoadableRedirectUri = false
    };

  2. Then I have allow to LinkedIn login access
    auth.Completed += (sender, eventArgs) =>
    {
    // We presented the UI, so it's up to us to dismiss it on iOS.
    if (eventArgs.IsAuthenticated)
    {
    auth.ShowErrors = false;
    Constants.AccountType = "LinkedIn";
    GlobalLogic.SaveAccount(eventArgs.Account, view.IsFromReauthentication);
    }
    else
    {
    // The user canceled
    }
    };

  3. And I am getting eventArgs.IsAuthenticated = true and also getting AccessToken and ExpiredTime in eventArgs.Account.

  4. But I tried to get LinkedIn profile details from https://api.linkedin.com/v2/me LinkedIn API. That time I have faced the error "The token used in the request has been revoked by the user" in response.

I need a refresh token for getting LinkedIn profile details(Email Id, Profile picture, Name). Where do I get refresh token and how?

Thanks in advance.

@mannawar
Copy link

Did you included offline_acsess scope in your auth request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants