-
Notifications
You must be signed in to change notification settings - Fork 11
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
RenewAsync fails with NRE after initial success #99
Comments
Internal Ref: OKTA-535318 |
Want to add one observation here, My assumption is from renew token method, along with new access token we should receive new refresh token as well. correct me if I am wrong. |
hello @bryanapellanes-okta any update on this ? |
@NiranjanXamarin No update yet; this item has been slotted to an upcoming sprint with other priorities taking precedence. I will comment here when there is more to share. |
When I was facing NRE while logging into the app, I added a few additional properties in my oktaconfig file like serverId, discovery endpoints, authstatekey, authservicediscovery key like those. It worked for me. |
used await OktaContext.Current.SignInAsync(); this method to get access token , id token and refresh token. saved all information in preferences. then added a custom login to check if the access token is expired or not like following
Preferences.Get(PreferencesKey.ExpiryTime, DateTime.UtcNow)< DateTime.UtcNow.AddMinutes(5);
and then if the access token has expired then called renew token by passing stored refresh token await OktaContext.Current.RenewAsync(refreshToken);
this time I am getting response with refresh token and the expiresIn seconds , so I Updated both values in preferences like:
expiresIn = DateTime.UtcNow.AddSeconds(renewedToken.ExpiresIn);
RefreshToken = renewedToken.RefreshToken;
Now , after the expiration of this new refresh token that means (3600) when aI tries to get new refresh token with await OktaContext.Current.RenewAsync(refreshToken); I am getting a response with null values and the exception of object reference not set
Originally posted by @NiranjanXamarin in #59 (comment)
The text was updated successfully, but these errors were encountered: