Refresh token is null in AuthenticationCallback
See original GitHub issueLock version : 2.8.0. Could be related to issue#52
Based on information I’ve read here and here I cloned this project and:
- changed credentials to mine.
- added
builder.withScope("offline_access openid")
With all that being said I’m expecting refreshToken
to be present in AuthenticationCallback after a user has been logged in, but it’s null here
public void onAuthentication(Credentials credentials) {
showResult("OK > " + credentials.getRefreshToken());
}
I’ve also read If I set response_type
to token
instead of default code
that could solve the issue, unfortunately I can’t find the place where I can do it in Auth0Lock.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
IdentityServer4 Refresh Token Is Null - Stack Overflow
I have a problem with IdentityServer4 where the token response does not contain a refresh token. The code I have already works fine ......
Read more >PublicClientApplication Class - Microsoft Learn
AuthorizationActivity. scopes - The non-null array of scopes to be requested for the access token. MSAL always sends the scopes 'openid profile offline_access ......
Read more >Refresh token Coming null - Okta Developer Community
Hi , I am using spring with dynamic client registration with okta. When user tries to access the resources, app is redirecting to...
Read more >com.microsoft.aad.adal4j.JwtHelper.buildJwt java ... - Tabnine
It contains Access * Token and the Access Token's expiration time. Refresh Token * property will be null for this overload.
Read more >SingleAccountPublicClientApplic...
String[] scopes, AuthenticationCallback callback) ... The access token returned is for MS Graph and will allow you to query for additional information about ......
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
I can’t reproduce it. I cloned this repo, replaced the credentials in the String.xml file with my own. Then added those 3 lines above to the builder configuration and run the sample. When I attempt to log in using a database connection user in classic Lock I get this log output:
Check in your “https://my.audience” API settings (Auth0 Dashboard) that it allows users to obtain a Refresh Token. The next toggle must be turned ON:
On the Client configuration there’s an advanced settings section that allows you to enable or disable Grant Types for that client. This should be enabled already, but check it anyway:
Please do not include nor use the client_secret as part of a public client such as mobile app. Secrets are meant to be secrets, and there are specific flows designed to be used on these applications that don’t need such disclosure. The refresh token will be present on the response as long as the
scope
parameter on the log in request included theopenid offline_access
values, and as long as the application is of type “native” with “allow offline access” turned on.As a reminder, while refresh tokens can be revoked, they do not expire and can be used to get a new pair of tokens, so treat them with the same level of secrecy as passwords.