Auth Service
object AuthService
Shared service for authentication logic, including JWT handling and token issuing.
Functions
Link copied to clipboard
Shared authentication logic for both OAuth and Password handlers.
Link copied to clipboard
Creates an access token for the given user.
Link copied to clipboard
Finds a user associated with an OAuth provider and user ID.
Link copied to clipboard
Generates a secure random secret of the given bytes length, encoded as Base64.
Link copied to clipboard
Issues a pair of access and refresh tokens for the given user.
Link copied to clipboard
context(_: JdbcTransaction, _: Raise<Issue>)
fun linkOrCreateUser(provider: String, providerUserId: String, preferredUsername: String, email: String, currentPrincipal: Principal? = null): UserEntity
fun linkOrCreateUser(provider: String, providerUserId: String, preferredUsername: String, email: String, currentPrincipal: Principal? = null): UserEntity
Links a new OAuth account to an existing user or creates a new user.
Link copied to clipboard
context(_: Raise<Issue>, _: AuthType, req: Request)
fun refresh(): ApiResponse<TokenResponseModel, Empty>
fun refresh(): ApiResponse<TokenResponseModel, Empty>
Link copied to clipboard
Shared logic to refresh a token pair using a refresh token.
Link copied to clipboard
Verifies the given refreshToken and returns the associated UserEntity if successful.
Link copied to clipboard
Verifies the given token and returns the subject (user ID) if successful.