Issuer (iss) claim mismatch in the ID token for Xamarin (Android)

Hello!

I posted this on another forum and one person redirect me to this.

I’m trying to integrate Okta on my Xamarin application (Android) using Auth0.OidcClient.AndroiX.

I have this on my MainActivity

[Activity(Label = “Some Name”, Icon = “@s”, Theme = “@style/MainTheme”, MainLauncher = true,
LaunchMode = LaunchMode.SingleTask ,ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

[IntentFilter(
new { Intent.ActionView},
Categories = new { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataScheme = MyAppPackageName,
DataHost = MyDomain,
DataPathPrefix = “/android/MyAppPackageName/callback”)]

protected override void OnNewIntent(Android.Content.Intent intent)
{
base.OnNewIntent(intent);

Auth0.OidcClient.ActivityMediator.Instance.Send(intent.DataString);

}

And this is the function:

public async Task LoginOkta()
{
string attribute = “”;

try
{              
    string domain = UtilitiesLayer.Code.AppBase.OktaDomain;
    string clientId = UtilitiesLayer.Code.AppBase.OktaClientId;

    Console.WriteLine("******************** " + domain + " *******************");

    Auth0ClientOptions options = new Auth0ClientOptions
    {
        Domain = domain,
        ClientId = clientId,
    };

    options.PostLogoutRedirectUri = options.RedirectUri;

    Activity activity = CrossCurrentActivity.Current.Activity;
 
    Auth0Client client = new Auth0Client(options, activity);

    IdentityModel.OidcClient.LoginResult loginResult = await client.LoginAsync();

    if (loginResult.IsError)
    {

    }
    else
    {
        attribute = loginResult.User.FindFirst(c => c.Type.ToLower().Equals(UtilitiesLayer.Code.AppBase.OktaAttribute.ToLower()))?.Value;
    }


}
catch (Exception e)
{
    Console.WriteLine("******************** " + e.Message + " *******************");
}
return attribute;

}

So, when I execute the LoginAsync() it returns an exception:

Issuer (iss) claim mismatch in the ID token; expected “link://myDomain/”, found “link://myDomain”

As you can see the difference between both is a slash (“/”).

So why does the function add a slash, is there something I’m missing?

Thank you

Hi,

Anyone knows how to fix this?

Greetings