Can't configure lock in Xamarin; Access token not JWT

I’m trying to use auth0 to allow a client on a mobile app to connect to an API.

After login, I get back an “access token” that isn’t a JWT, and the server (which I have already tested) doesn’t recognize whatever this thing is.

I’ve seen answers to similar questions where the OP is told they need to modify the Lock configuration, but, the Auth0 Xamarin component doesn’t seem to have any interfaces to do this.

Please advise.

Nevermind. I see the Xamarin Auth0 SDK is dead software. You people should cut that sort of thing out. I wasted two hours trying to figure this out when I should have skipped it altogether. It does not belong in your manuals. Dead interfaces do not belong in your manuals.

So, if you are starting off with this sample: https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Quickstart/01-Login

You will want to pay attention to the options parameter of LoginAsync. Easiest to just use an anonymous type here - its going to get converted into a dictionary prior to being serialized for the request that gets made. Using this enabled me to get a JWT in the access token with the correct audience.

var client = new Auth0Client(new Auth0ClientOptions
{
   Domain = "yourdomain.auth0.com",
   ClientId = "some client id",
   Controller = this.GetTopmostController(),
   Scope = "openid email profile"
});
    
var options = new {audience = "https://yourapiaudience.com", responseType = "id_token token"};
    
var loginResult = await client.LoginAsync(options);
1 Like

Nevermind. I see the Xamarin Auth0 SDK is dead software. You people should cut that sort of thing out. I wasted two hours trying to figure this out when I should have skipped it altogether. It does not belong in your manuals. Dead interfaces do not belong in your manuals.