How to get offline token
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [ ] bug report -> please search for issues before submitting
- [X] feature request
Versions.
"keycloak-angular": "^7.1.0",
"keycloak-js": "4.8.3",
Desired functionality.
How could we get offline tokens?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13
Top Results From Across the Web
Offline Sessions and Offline tokens within Keycloak - JANUA
This article is dedicated to describe the behaviour and usage of offline sessions and offline tokens within Keycloak. The behaviour of offline tokens...
Read more >Offline Access | keycloak-documentation
Users can view and revoke offline tokens that have been granted by them in the User Account Service. The admin user can revoke...
Read more >Offline token with Keycloak - Huong Dan Java
The first thing you need to know is how we get the offline token. · We can use this offline token to get...
Read more >Get Refresh Tokens - Auth0
To get a refresh token , you must include the offline_access scope when you initiate an authentication request through the /authorize endpoint. Be...
Read more >What does "offline" access in OAuth mean? - Stack Overflow
If a refresh token is present in the authorization code exchange, then it can be used to obtain new access tokens at any...
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 Free
Top 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
Sorry. I do use the
login-required
option in theinitOptions
of thekeycloak.init
.I was expecting a way to pass the requested scope via this interface but found nothing.
Do you mean I should remove the
login-required
value and trigger manuallykeycloak.login()
after the initialization?Other remark: Could anyone tell me if my approach (using offline token for a PWA application) is a good one? Does it make sense?
Thanks for your help!
If I replace my code whith the following :
(remove
onLoad: 'login-required'
) and pass the scope in thelogin
method, I can get a offline token.By the way, I’ve experienced the same problem as stated in the mail list : (when doing a logout all via the admin console) https://lists.jboss.org/pipermail/keycloak-user/2018-May/014128.html
Now, to be able to reuse the offline token, I guess I should store it in my local storage. (to avoid recreating a new token when I reload my page. Do you know if it’s a good practice to put an offline token in the local storage?