All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.security.oauth.server.AccessTokens.kt Maven / Gradle / Ivy

package org.http4k.security.oauth.server

import dev.forkhandles.result4k.Result
import org.http4k.security.AccessToken
import org.http4k.security.oauth.server.accesstoken.AuthorizationCodeAccessTokenRequest

/**
 * Provides a consistent way to generate access tokens.
 */
interface AccessTokens {
    /**
     * Creates a new access token for a valid authorization code.
     */
    fun create(
        clientId: ClientId,
        tokenRequest: AuthorizationCodeAccessTokenRequest,
    ): Result

    @Deprecated(
        "AuthorizationCode is already present in the tokenRequest, so use that",
        ReplaceWith("create(clientId, tokenRequest: AuthorizationCodeAccessTokenRequest)")
    )
    fun create(
        clientId: ClientId,
        tokenRequest: AuthorizationCodeAccessTokenRequest,
        authorizationCode: AuthorizationCode
    ): Result = create(clientId, tokenRequest)

    /**
     * creates a new access token for a given client.
     */
    fun create(clientId: ClientId, tokenRequest: TokenRequest): Result
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy