AppAuth-Kotlin
AppAuth-Kotlin

Built and maintained with 🧡 by GitLive
Real-time code collaboration inside any IDE
The AppAuth-Kotlin SDK is a Kotlin-first SDK for AppAuth. It's API is similar to the
Open ID AppAuth Android but also supports multiplatform projects, enabling you to use AppAuth directly from your common source targeting
iOS,
Android or
JS.
Installation
To install simply add to your common sourceset in the build gradle
implementation("dev.gitlive:appauth-kotlin:0.0.1")
Perform a gradle refresh and you should then be able to import the app auth files.
Useage
val config = AuthorizationServiceConfiguration(
authorizationEndpoint = "https://endpoint/oauth/authorize",
tokenEndpoint = "https://endpoint/oauth/token",
endSessionEndpoint = "https://endpoint/oauth/logout"
)
val request = AuthorizationRequest(
config,
"CLIENT_ID",
listOf("openid", "profile", "member"),
"code",
)
{
response = authorizationService.performAuthorizationRequest(request)
tokenRequest.emit(response.createTokenExchangeRequest())
} (exception: AuthorizationException) {
println()
}