-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
OidcUsermanger.currentuser returns null after some few days or hours #126
Comments
perhaps the access token expired and no refresh token was provided by the idp? check if you requested offline_access scope |
I am seeing the same behavior even though I have a refresh token I'm getting back. What's interesting is if I log the expiresIn from the currentUser's token it always shows it expires in 74 minutes even as time is passing by. Perhaps the auto refresh isn't working because of an issue with the logic that calculates the expiresIn duration? |
@egfconnor |
please provide your idp discovery document if possible |
@ahmednfwela ah okay that makes more sense then. My idp discovery document includes offline_access in the scopes_supported section if that's what you're wondering about? I also specify that in my scope array in OidcUserManagerSettings. |
Is there any ways you would recommend I could debug if it's attempting to refresh or not? I can use Flutter Dev Tools Network panel for instance to observe specific network requests, or enable some sort of log? |
can you also check the supported grants in the discovery document if they include refresh token? |
Thanks for the help @ahmednfwela it turns out my discovery document for Microsoft Entra doesn't include a 'grant_types_supported' section at all. I manually added it via OidcProviderMetadata.fromJson() and refresh is working great now. |
that's great to hear @egfconnor ! |
@egfconnor .. mind providing a code sample for your solution please |
Then of course you need to call:
|
another option is to also override the discovery document https://bdaya-dev.github.io/oidc/oidc-usage/#overriding-the-discovery-document |
After login in , quering the current user returns null after some hours , or days
The text was updated successfully, but these errors were encountered: