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

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

Merged
merged 1 commit into from Dec 5, 2022

Conversation

KhaledAlMana
Copy link
Collaborator

@KhaledAlMana KhaledAlMana commented Dec 4, 2022

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 }, },

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
    },
  },
@KhaledAlMana KhaledAlMana changed the title Update callback.ts Update callback.ts - support response type 'code' Dec 4, 2022
@aborn aborn merged commit 41eb586 into aborn:main Dec 5, 2022
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 this pull request may close these issues.

None yet

2 participants