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

Instagram Login: I am getting Invalid scope field(s) exception Xamarin.Forms using Xamarin.Auth, how to fix? #449

Open
divyesh008 opened this issue Nov 3, 2020 · 0 comments

Comments

@divyesh008
Copy link

Xamarin.Auth Issue

Invalid scope field(s) exception in Android

var authenticator = new OAuth2Authenticator(
    clientId: Keys.InstagramClientId,  
    scope: "basic",  
    authorizeUrl: new Uri("https://api.instagram.com/oauth/authorize/?client_id=" + Keys.InstagramClientId + "&redirect_uri=https://localhost:3000/callback&response_type=token"),
    redirectUrl: new Uri("https://localhost:3000/callback"))
{
    AllowCancel = true,
    ShowErrors = false,
    ClearCookiesBeforeLogin = true
};

AuthenticationState.Authenticator = authenticator;

authenticator.Error += (sender, eventArgs) =>
{
    activity.Finish();
};

authenticator.Completed += (sender, eventArgs) =>
{
    if (eventArgs.IsAuthenticated)
    {
        App.AccountType = "Instagram";
        App.SaveAccount(eventArgs.Account, view.IsFromReauthentication);
    }
};

var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(authenticator);

Steps to reproduce

  1. Try to login with instagram
  2. It will show this exception

Platform:

  • [] .NET version = 3.1.402
  • [] mono version = 6.12.0.93

Expected behaviour

Login successfully and redirect back to application

Tell us what should happen

Actual behaviour

Getting Invalid scope field(s) exception

Tell us what happens instead
Can you also include a screen shot?

Insta_Exception

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

1 participant