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

scopes not matching #1

Open
skoblenick opened this issue Jan 15, 2021 · 2 comments
Open

scopes not matching #1

skoblenick opened this issue Jan 15, 2021 · 2 comments

Comments

@skoblenick
Copy link

I saw your presentation at ng-conf on Authentication & Authorization. In the presentation your slides clearly show the email from the profile page working however when I use your demo from (step 5) or a stripped down angular app based on https://auth0.com/docs/libraries/auth0-angular-spa (which has several mistakes in the code examples) I don't get email address back in the user$ response.

I see the correct scopes being requested in the app's redirect to auth0 but the response (on my striped down version) returns:

&redirect_uri=http%3A%2F%2Flocalhost%3A4200
&scope=openid%20profile%20email
&response_type=code
&response_mode=query
&nonce=

I have tried this with both user-password and google authentication with the same result.

After the redirect back to the application I see the following:

auth0-spa-js.production.esm.js:15 The requested scopes (openid profile email) are different from the scopes of the retrieved token (openid profile read:messages). This could mean that your access token may not include all the scopes that you expect. It is advised to resolve this by either:
  - Removing `email` from the scope when requesting a new token.
  - Ensuring `email` is returned as part of the requested token's scopes.

And no email returned in the user's object:

{
  "given_name": "Given",
  "family_name": "Family",
  "nickname": "my.nickname",
  "name": "My Name",
  "picture": "https://lh3.googleusercontent.com/.../photo.jpg",
  "locale": "en",
  "updated_at": "2021-01-15T19:46:02.364Z",
  "sub": "google-oauth2|uuid3"
}

Idk where read:messages is coming from, per the warning.

I have attempted to set the options on the AuthModule.forRoot() to change the default scopes with no luck. Any ideas?

@SpikedCola
Copy link

Hey Ryan,

Is the scope "read:messages" set/coming from the API configuration on Auth0? Here is a sample screenshot.

@skoblenick
Copy link
Author

@SpikedCola atm I do not have a machine-to-machine API setup on the application. This is just the SPA application portion of the application from step 5

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

2 participants