-
Notifications
You must be signed in to change notification settings - Fork 270
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
The JSDoc for getToken states it calls updateToken if necessary, but it does not #531
Comments
I know this is an extremely minor change, especially since keycloak-angular automatically attempts to update the token when using the HttpInterceptor or you can just use the I'm submitting a PR shortly to add an option to refresh the token when |
Bug Report or Feature Request (mark with an
x
)Versions.
keycloak-angular: 13.1.0
keycloak-js: 21
angular: 15.2.9
Repro steps.
#getToken()
. The existing, expired token will be retrieved.The log given by the failure.
No logs given, the token is just returned.
I did, however, run a rudimentary test. I called getToken() to get a token, then I used setTimeout to call getToken again 5 minutes later, which is when my token expires. As you can see, the tokens ended up being the same. I then attempted to access a resource that requires a valid token, which returned a 401 unauthorized, proving the token is bad.
Desired functionality.
The token is updated as JSDoc states. I would like to either see the JSDoc updated to not state that the token is refreshed, or have the token actually refresh instead. I know there is a
keycloakEvents$
Subject which has an OnTokenExpired event, so personally I'd like to just see the JSDoc updated to reflect that getToken does not refresh it, but instead gets the last known token.The text was updated successfully, but these errors were encountered: