org.http4k.security.oauth.server.AuthRequestExtractor.kt Maven / Gradle / Ivy
package org.http4k.security.oauth.server
import dev.forkhandles.result4k.Failure
import dev.forkhandles.result4k.Result
import dev.forkhandles.result4k.Success
import org.http4k.core.Request
import org.http4k.lens.LensFailure
fun interface AuthRequestExtractor {
fun extract(request: Request): Result
}
object AuthRequestFromQueryParameters : AuthRequestExtractor {
override fun extract(request: Request): Result =
try {
Success(request.authorizationRequest())
} catch (e: LensFailure) {
Failure(InvalidAuthorizationRequest(e.failures.joinToString("; ")))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy