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

Explanation of Audience in ReadMe and How to Create An API In Auth0 Needed #469

Closed
4 tasks done
IanTaite opened this issue Dec 6, 2023 · 5 comments · Fixed by #470
Closed
4 tasks done

Explanation of Audience in ReadMe and How to Create An API In Auth0 Needed #469

IanTaite opened this issue Dec 6, 2023 · 5 comments · Fixed by #470

Comments

@IanTaite
Copy link

IanTaite commented Dec 6, 2023

Checklist

Describe the problem you'd like to have solved

In the "Auth0 Configuration for the Sample Application(s)" section of the ReadMe, the instructions state that (I paraphrase) "The example application(s) require to be configured with your Auth0 information to run successfully. This can be done by replacing {DOMAIN}, {CLIENT_ID} and {API_IDENTIFIER} with your tenant-specific values in auth_config.json."

With regard to API_IDENTIFIER, this explanation/instruction is too vague.

As a beginner using Auth0 for the first time, it is not at all clear what the API_IDENTIFIER is or where I would get the value. The above instructions imply it's from within the Auth0 settings where DOMAIN and CLIENT_ID are located, whereas in fact for this demo repo, in the Auth0 Dashboard,

  • You create an application, and the application has a DOMAIN and a CLIENT_ID.
  • You also create an API. As part of that process, you would add an Identifier and as the prompt states, (this is a) "Unique identifier for the API. This value will be used as the audience parameter on authorization calls."

It seems the API is the source of the API_IDENTIFIER value to be entered in auth_config.json, but nowhere does it state that you have to create one to be able to get this value.

I've spent almost all of today on this, and for want of better/clearer instructions my time would not have been wasted.

Describe the ideal solution

The ideal solution would be for the ReadMe notes to be clearer about what it takes to get a value for API_IDENTIFIER so that no one else wastes time discovering this for themselves.

Alternatives and current workarounds

I honestly hope I've not overlooked something. If I should have gone elsewhere to gain this "prior knowledge", or the "prior knowledge" could be alluded to by linking to it in the read me then that might also do.

Additional context

n/a

@frederikprijck
Copy link
Contributor

frederikprijck commented Dec 6, 2023

Hey, a question I have here is if you looked at our sample in isolation, or where you following https://auth0.com/docs/quickstart/spa/angular/ ?

Our sample is a sample that's for that quickstart in particular. If you go to that link, login and download the sample, everything is filled in for you.

Additionally, all the API information can be found at https://auth0.com/docs/get-started/apis/api-settings, which should explain what identifier is in the context of the API.

We do have a bit more documentation on our SDK repo, and not on our sample, see: https://github.com/auth0/auth0-angular/blob/main/EXAMPLES.md#call-an-api

In order for Auth0 to be able to issue tokens for a specific API, we need to configure the Audience to inform Auth0 about the API in question. Set the audience, when calling AuthModule.forRoot(), to the API Identifier of the API from within your Auth0 dashboard.

I do recommend to read the documentation for the SDK, and not the sample as that's typically not the place were we document these things as this is nothing but a sample to show how it works, not documentation on how to configure our SDK.

That said, happy to look into how we can improve here as well.

@IanTaite
Copy link
Author

IanTaite commented Dec 6, 2023 via email

@frederikprijck
Copy link
Contributor

When I try to download the (pre-configured) sample, I'm getting a HTTP 400
error, posting to https://auth0.com/docs/package/v2. I think this example
just does login and logout though.

Apologies, I broke something while renaming the master branch to main in this samples repository, and a fix is underway to get that resolved. So even thought my elaboration on the automatic configuring is typically true, for the Angular Samples it will work again once the fix is deployed, sorry about that.

I've spent a bit of today wondering why there are two repos:
https://github.com/auth0-sample and https://github.com/auth0-developer-hub

I am not involved with the auth0-developer-hub, and it's not maintained by the team that builds and maintains the SDK. The Auth0-Samples is.

I'm not having a very good dev experience at the moment.

Please let me know where I can help, as that is definetly not our intention and we always try to improve were possible.

@frederikprijck
Copy link
Contributor

frederikprijck commented Dec 6, 2023

Reopening, merging the PR closed this while I believe we are still discussing things.

@frederikprijck frederikprijck reopened this Dec 6, 2023
@frederikprijck
Copy link
Contributor

Downloading the sample on the Quickstart works as expected now, apologies, that one was on me.

Closing as it is fixed now, and the experience should be better. Feel free to reach out when things can still be improved.

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

Successfully merging a pull request may close this issue.

2 participants