AppAuth in my opinion as a library lacks a lot of supporting documentation on how to use the library itself. There are methods like performActionWithFreshTokens() vaguely documented. For example how do I go about using this method to refresh token. I also wonder if the documentation will be clear enough to be interpreted for Kotlin.
What brings me here again is to ask, how do I use this library to perform refresh tokens for the following circumstances on android (Kotlin).
To request a token for the first is successful. Now say the app is dismissed or stays running in the background for sometime and when it is restarted again the access_token has expired...
At this point in time, trying to refresh the access token and other tokens using this method createTokenRefreshRequest() or performActionWithFreshTokens() requires the chrome tabs intent to show and ask the user to enter the username and password again (same as doing it for the first time).
Is this by design and is there a way I can refresh the tokens without the need for chrome tabs intent showing?
Using a combination of AppAuth and OkHttp is the client.
Having tried all sorts in trying to achieve this, this is the behaviour I get all the time. Somewhat confused whether the chrome tabs intent should show when attempting to refresh or getting a new access token.