Invalid Audience when trying to authenticate with Entra Id

Jai Holloway 0 Reputation points
2024-07-04T09:32:51.23+00:00

I have written a MAUI application and followed the MAUI authorization flow from the ms-identity-dotnetcore-maui repo.

I have created an API registration and added the scopes, as per the documentation for securing a maui app. I have also create a client app and given it rights to the api. I then have published the api to an azure app service.

I manage to login and get back an access, but I can't use the access token as I keep getting an error with it, so I tried using the id token. The id token keeps throwing an error of invalid audience. I have checked the audience in the JWT and it is the native app registration client id. I can't use the api client id, because that throws an error of does not contain a redirect uri and I can't add the redirect uri because it is msal<clientId>://auth, and it expects the uri to start with https://

I am at a complete loss at the moment. I can't find any resources to help me with this error. Any suggestions would be greatly appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,361 questions
0 comments No comments
{count} votes