Missing scope in access token

I am developing a Blazor Server app with Auth0. Because I am incorporating roles and will be manipulating them in the app, I need to access the API. I am managing to create an access token, but on examination in a JWT decoder, I have found that it does not contain any of my needed scopes, thus generating an error when I try to use it.

The audience in the token is correct, and (through research) I have tried many different ways to include the scopes, Normal authentication into the app works correctly.

To quote TeX, I’m stymied.

I can give code samples, if needed.

Thanks!

Hi @david42

Welcome to the Auth0 Community!

Thank you for posting your question. I’ve checked your tenant, and it looks like you don’t have an API created in the tenant associated with your Auth0 Community Account. To request an access token for a specific tenant, you need to create an API first in the Auth0 Dashboard → https://auth0.com/docs/get-started/apis. You can read more about access tokens here → https://auth0.com/docs/secure/tokens/access-tokens.

Thanks!
Dawid

Greetings,

I’ve created an API in the dashboard, as you suggested, though I’m not sure I’ve done so correctly, as I’m now getting a “401 - Bad Audience” error. I replaced the the audience in the code in the appropriate places. I’m not sure where to proceed from here. Please advise.

Thanks!

David

I solved the problem by accessing the Management API, as discussed in Jim Engstrom’s course, “Auth in Blazor”, on Dometrain.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.