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

Option to use oauth IdToken instead of AccessToken #119

Closed
sschadwick opened this issue Apr 4, 2018 · 3 comments
Closed

Option to use oauth IdToken instead of AccessToken #119

sschadwick opened this issue Apr 4, 2018 · 3 comments

Comments

@sschadwick
Copy link
Contributor

sschadwick commented Apr 4, 2018

What problem does this feature solve?

Currently, the auth-module uses the returned AccessToken and attaches it to each request (via the axios module). https://github.com/nuxt-community/auth-module/blob/master/lib/schemes/oauth2.js#L92

My current environment (AWS Cognito, Api Gateway Authorizer => Lambda) checks for and evaluates the IdToken. When I attempt to use the AccessToken, my api endpoints return a 401 Unauthorized.

What does the proposed changes look like?

Add a config option to utilize the returned IdToken instead of AccessToken. Default setting should still use AccessToken.

This feature request is available on Nuxt.js community (#c85)
@ghost ghost added the cmty:feature-request label Apr 4, 2018
@pi0
Copy link
Member

pi0 commented Apr 4, 2018

Hey. Would you please share your current auth config? (Which provider/scheme are you using)

@sschadwick
Copy link
Contributor Author

Thanks for the quick reply, here's my config:

auth: {
  strategies: {
    oauth: {
      _scheme:                'oauth2',
      authorization_endpoint: 'https://<congitoInstance>.auth.us-west-2.amazoncognito.com/oauth2/authorize',
      userinfo_endpoint:      '',
      scope:                  [],
      response_type:          'token',
      token_type:             '',
      redirect_uri:           '<siteDomain>',
      client_id:              '<cognitoClientId>'
    }
  }
},

@pi0
Copy link
Member

pi0 commented Apr 4, 2018

Thanks, @sschadwick for info. That'll help moving forward.

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

No branches or pull requests

3 participants