AppAuth-Android
AppAuth-Android copied to clipboard
Add methods to request access token synchronous
in kotlin you can easily do it with extension and suspendable method:
internal suspend fun AuthState.performActionWithFreshTokens(service: AuthorizationService): String =
suspendCancellableCoroutine { cont ->
performActionWithFreshTokens(service) { accessToken, idToken, ex ->
if(accessToken != null) {
cont.resume(accessToken)
} else {
cont.cancel(ex)
}
}
}