Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

AppAuth-Kotlin

AppAuth-KotlinGitHub last commit

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

Stable Release

To install simply add to your common sourceset in the build gradle:

implementation("io.github.yet300:appauth-kotlin:0.1.2") 

Import Statement

Use the new package name in your imports:

import dev.yet300.appauth.*

Perform a gradle refresh and you should then be able to import the app auth files.

Usage

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",
    "callback://oauth/callback"
)
try {
    val response = authorizationService.performAuthorizationRequest(request)
    tokenRequest.emit(response.createTokenExchangeRequest())
} catch (exception: AuthorizationException) {
    println("User attempted to cancel login")
}

Development

Building

./gradlew clean build

Testing

./gradlew test

Code Quality

./gradlew ktlintCheck

Deployment

This project is configured for deployment to Maven Central. See DEPLOYMENT.md for detailed instructions.

Quick Deploy

  1. Update version in gradle.properties
  2. Set environment variables for OSSRH credentials and GPG signing
  3. Run: ./gradlew publishToOSSRHRepository
  4. Complete the release process on OSSRH

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run ./gradlew ktlintCheck to ensure code quality
  6. Submit a pull request

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages