-
Notifications
You must be signed in to change notification settings - Fork 694
Cognito Id_token not processed when oidc is set to True #385
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
Comments
Check user requestType paramater before apply default responseType. So the user can define the behavior. Closes: manfredsteyer#385 See: manfredsteyer#385
Just so it's clear to me, in order to make this work for Cognito would you have to set |
@gwosty Currently you need to set In PR #397 a change is proposed that allows you to set So before the PR: if (this.oidc && this.requestAccessToken) {
this.responseType = 'id_token token';
} else if (this.oidc && !this.requestAccessToken) {
this.responseType = 'id_token';
} else {
this.responseType = 'token';
} After: if (this.config.responseType) {
this.responseType = this.config.responseType;
} else {
if (this.oidc && this.requestAccessToken) {
this.responseType = 'id_token token';
} else if (this.oidc && !this.requestAccessToken) {
this.responseType = 'id_token';
} else {
this.responseType = 'token';
}
} PS. You mention "requestType" but I've assumed you meant |
Sorry, yes, I meant the responseType. I think the pull request only fixes the call but not the actual saving of the token. In https://manfredsteyer.github.io/angular-oauth2-oidc/docs/injectables/OAuthService.html#source line 1314 we would not process the id_token if oidc is not set to true. |
I can confirm that Setting oidc true and handling responseType for cognito works. I was able to see both access token and id token. |
@manfredsteyer I can see that the pull request for this is still open. Is it ok that for now, If I import the project in my application and modify the source code for the fix? I believe the license is Thanks, |
yes, it's absolutely ok. It's MIT. Will at a license file. |
In manfredsteyer#30 the maintainer @manfredsteyer mentions adding an MIT license, but in 5b8cbbe it was accidentally removed. In manfredsteyer#385 it was mentioned that the license should be added back. So that's what we do here! Fixes manfredsteyer#370 See also manfredsteyer#385 See also manfredsteyer#30
I am trying to use this library with cognito and cognito requires response_type=token and returns both access_token and id_token. Library seems to have hardcoded the response_type for such scenario to be
token id_token
https://github.com/darbio/angular-oauth2-oidc/blob/master/angular-oauth2-oidc/src/oauth-service.ts#L955-L957
Is there any workaround to make this work?
Thanks
The text was updated successfully, but these errors were encountered: