Problems when getting started with Auth0
I get an error page that says Unauthorized.
- sample-01 application from GitHub
- Angular single-page application
- Running on localhost, starting with “npm run dev”
- None of the files in Git changed.
-
auth_config.json
coped fromauth_config.json.example
, and modified
What I see
- http://localhost:4200/ has a nice start page with a blue Log in button
- First time I click on the Log in button, I’m taken to Auth0 login screen,
where I select Google. - Then I’m taken to http://localhost:4200/error, and there is the word
Unauthorized on red background. - Further attempts to log in from the start screen takes me directly to the
error page. This may change after a day of inactivity.
I’ve looked at the Auth0 dashboard, Monitoring → Logs. There I see
Successful Login and Failed Exchange. I don’t understand the details of
these, or what to look for.
auth_config.json
file
Three items changed, as compared to the exampe file:
- “domain”: “dev-0dbn2nahjvxav1r1.us.auth0.com”, this includes my tenant name,
as seen on https://manage.auth0.com/dashboard/us/dev-0dbn2nahjvxav1r1/tenant/general- The region for this tenant is not where I am; it says US-4, and I’m in
Sweden.
- The region for this tenant is not where I am; it says US-4, and I’m in
- “clientId”: “6DbQhOkIEi5gx8mCWEwgfSW5PnIhwPHJ”
- this is the Client ID of the first application on my Applications list,
as seen on https://manage.auth0.com/dashboard/us/dev-0dbn2nahjvxav1r1/applications - I have two more applications:
- one Machine to Machine application, with a name that corresponds to
the API name - “My App”, a single page application that I’m not sure how it got created.
- one Machine to Machine application, with a name that corresponds to
- this is the Client ID of the first application on my Applications list,
- “audience”: “hartappat-demo-v1”, this is the same as the identifier of the
Custom API that I defined.
Settings for Default App
- Allowed Callback URLS: http://localhost:4200/
- Allowed Logout URLS: http://localhost:4200/
- Allowed Origins (CORS): http://localhost:4200/
That’s it, I think. I must have missed something, since I have the
Unauthorized problem
Why do I get Unauthorized? Are my expectations wrong?
Off-topic: I have a very hard time tagging this post with at least two tags, I think login-experience should be a valid tag, but the search function for tags doesn’t seem to work. “documenation-request” is not a good tag for this post, but I can’t insert another one.