useHttpBasicAuthForPasswordFlow not working when refreshToken
See original GitHub issueHi everybody!
I use password flow for OAuth2.
I’ve configured with useHttpBasicAuthForPasswordFlow: true
, it works fine with fetchTokenUsingPasswordFlow
.
But when I want to refresh the token, stop as it does not work
this.oauthService.events.subscribe (e => {
console.log ('oauth / oidc event', e);
if (e.type == 'token_expires') this.oauthService.refreshToken (). then (value => console.log (value));
};
I checked the Http Request Header, which does not have the Authorization header with Basic. Please help me. Thank you very much!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6
Top Results From Across the Web
Angular 6: refresh token not working as expected
I have auth.interceptor.ts to added each request with access_token to authorize the request. import {HttpEvent, HttpHandler, HttpInterceptor, ...
Read more >Refreshing a Token - angular-oauth2-oidc
Refreshing a Token using Code Flow (not Implicit Flow!) ... Please also note, that you have to request the offline_access scope to get...
Read more >Access Token Stops Working after Refresh Token - Help - Intuit
So, i have a working Access token object, then i use this object to do a refresh token, and i successfully generate a...
Read more >Issue with refresh token - ServiceNow Community
By default, an instance issues refresh tokens with a 100-day lifespan in the scenario where the instance is the OAuth provider. For third-party ......
Read more >Refresh Token - Constant Contact Community - 332029
How soon does the refresh token expire? ... We are working on a video to clearly document the problem and the way we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I was about to file the same issue at the moment. The method
refreshToken()
does not set the Basic Authentication Header (oauth-service.ts, line 738):as it does in
fetchTokenUsingPasswordFlow()
:The obvious workaround would be to to copy this code into refreshTocken() or to extract a method and call it at both places, but I do not know what happen when using implicit flow if I did that.
@manfredsteyer: Any advice how I can help?
At the moment my workaround is crude (in the interceptor):
Seems like an omission to me then? A PR to fix this would be good.
The reason this might’ve been overlooked (apart from lacking tests) is that the Password Flow isn’t very popular (as it’s considered unsuitable for JS apps, meant for if you’re stuck with legacy architecture), and even when you do use that flow a client secret is quite useless (since the JS is public, not secret).
(I understand and appreciate that you and others might just have to deal with this flow, and the bug should of course be fixed. But at the same time I want to warn others landing here that still have a choice to consider other OAuth/OIDC flows.)