Integrate a mock auth server within your Kotlin application to issue tokens for development and testing purpose.
Currently only SNAPSHOTS are available at the sonatype snapshot repository. Add the following to your
buidl.gradle.kts
.
repositories {
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencies {
implementation("cloud.rio:mock-auth-server:0.2.0-SNAPSHOT")
}
Within a (integration) test that requires a token
import cloud.rio.iam.auth.MockAuthServer
fun test() {
MockAuthServer().use {
val port = it.start()
// do request a token on the random selected port on localhost
// do some code/tests with the token
// server is closed automatically after the use-block
}
}
Mock Auth Server is licensed under the Apache 2.0 license.