Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audience param (auth0_audience_domain) #75

Open
github0013 opened this issue Apr 25, 2020 · 0 comments
Open

audience param (auth0_audience_domain) #75

github0013 opened this issue Apr 25, 2020 · 0 comments

Comments

@github0013
Copy link

https://auth0.com/docs/quickstart/backend/nodejs/01-authorization

As far as I understand, when creating a backend to you would take access_token from client, and you would need to verify the token.
One of the key elements to check is audience.

Auth0.com asks to create an API with an identifier (can be anything - doesn't even have to start with https://, right?)
https://auth0.com/docs/getting-started/set-up-api

Identifier: a unique identifier for the API. Auth0 recommends using a URL. Auth0 does differentiate between URLs that include the last forward slash. For example, https://example.com and https://example.com/ are two different identifiers. The URL does not have to be a publicly available URL. Auth0 will not call your API. This value cannot be modified afterwards.

https://github.com/Swizec/useAuth/blob/v0.6.1/src/AuthProvider.tsx#L69

Here, the audience is pre-defined to be /api/v2/ and you are to pass auth0_audience_domain part instead of entire identifier text.

Of course you can overwrite it

https://github.com/Swizec/useAuth/blob/v0.6.1/src/AuthProvider.tsx#L75

like so, but why the provider takes auth0_audience_domain and uses /api/v2/ instead of just an identifier text?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant