aborn / nuxt-openid-connect

OpenID-Connect(OIDC) integration module for nuxt 3.0.
31 stars 16 forks source link

Update callback.ts - support response type 'code' #6

Closed KhaledAlMana closed 1 year ago

KhaledAlMana commented 1 year ago

I use gravitee am with the below configurations (at end). response_type 'code' will not work because callback is always expecting access_token in params. After login, user will be redirected to the callback url with code in params. That code will be used to obtain an access token.

I have updated this callback to be able to handle tokens.

BIG THANK YOU FOR THIS MODULE. You have saved me a lot of time.


openidConnect: { addPlugin: true, op: { issuer: 'https://MY_DOMAIN/am/oidc', clientId: 'CLIENT-ID-XXXXXX', clientSecret: 'CLIENT-SECRET-XXXXXX', callbackUrl: 'https://MY_DOMAIN/oidc/callback', scope: 'openid profile email', }, config: { response_type: 'code', secret: 'oidc._sessionid', cookie: {}, cookieMaxAge: 24 * 60 * 60, // default one day }, },