Skip to content

Instantly share code, notes, and snippets.

@naturalwarren
Created December 2, 2018 16:13
Show Gist options
  • Save naturalwarren/486903b9d609ea3fdadbe23ea36910a8 to your computer and use it in GitHub Desktop.
Save naturalwarren/486903b9d609ea3fdadbe23ea36910a8 to your computer and use it in GitHub Desktop.
Contract for providing and refreshing an access token.
/**
* Provides an access token for request authorization.
*/
interface AccessTokenProvider {
/**
* Returns an access token. In the event that you don't have a token return null.
*/
fun token(): String?
/**
* Refreshes the token and returns it. This call should be made synchronously.
* In the event that the token could not be refreshed return null.
*/
fun refreshToken(): String?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment