-
Notifications
You must be signed in to change notification settings - Fork 431
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
Obtaining new credentials with refresh code failed #725
Comments
Doing a bit more debug looks like there's an issue with AuthStateService.getRefreshToken():
If token is undefined decode turns it into a string "undefined". However, I'm still not sure why the refresh token is not there in authResult. |
Looking at OpenID connect Core, the client must include offline_access scope. So I changed my configuration to include offline_access in the scope: This has fixed the issue on my side. However, I think AuthStateService.getRefreshToken() can be improved as per comment above and this card can be closed. |
Thanks for reporting, yes, you must request the |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
My configuration is:
oidcConfigService.withConfig({ stsServer: 'https://our-server.com/oauth', redirectUrl: window.location.origin, postLogoutRedirectUri: window.location.origin, clientId: 'our-app', scope: 'openid profile ourapi', responseType: 'code', silentRenew: true, useRefreshToken: true, logLevel: LogLevel.Debug });
We are using identity 4 server with one time only refresh token, below is the configuration:
Here's the browser log of failure:
Looking at the browser's network tab the response to the "token" endpoint returned 404 with body:
{"error":"invalid_grant"}
Interestingly, probably the source of the problem, the form data from from the request shows token as undefined. Here's the raw of the request form data form network tab:
grant_type=refresh_token&client_id=our-app&refresh_token=undefined
Expected behavior
Silent renew with refresh token should work as expected.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: