api

http4k / org.http4k.security

Package org.http4k.security

Code relevant to interfacing with security mechanisms such as OAuth servers.

Types

Name Summary
AccessTokenContainer data class AccessTokenContainer
AccessTokenDetails data class AccessTokenDetails
AccessTokenFetcher class AccessTokenFetcher
AccessTokenResponse data class AccessTokenResponse
CrossSiteRequestForgeryToken data class CrossSiteRequestForgeryToken
InsecureCookieBasedOAuthPersistence class InsecureCookieBasedOAuthPersistence : OAuthPersistence
This is an example implementation which stores CSRF and AccessTokenEnvelope values in an INSECURE client-side cookie. Access-tokens for end-services are fully available to the browser so do not use this in production!
OAuthCallback class OAuthCallback : HttpHandler
OAuthPersistence interface OAuthPersistence
Provides persistence for OAuth lifecycle values:
OAuthProvider class OAuthProvider
Provides a configured set of objects for use with an OAuth2 provider.
OAuthProviderConfig data class OAuthProviderConfig
OAuthRedirectionFilter class OAuthRedirectionFilter : Filter
ResponseType enum class ResponseType

Type Aliases

Name Summary
CsrfGenerator typealias CsrfGenerator = () -> CrossSiteRequestForgeryToken
RedirectionUriBuilder typealias RedirectionUriBuilder = (Uri, AuthRequest, state: String) -> Uri

Properties

Name Summary
accessTokenResponseBody val accessTokenResponseBody: BiDiBodyLens<AccessTokenResponse>
defaultUriBuilder val defaultUriBuilder: RedirectionUriBuilder

Functions

Name Summary
uriBuilderWithRequestJwt fun uriBuilderWithRequestJwt(requestJwts: RequestJwts): (Uri, AuthRequest, String) -> Uri

Companion Object Functions

Name Summary
auth0 fun OAuthProvider.Companion.auth0(auth0Uri: Uri, client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence): OAuthProvider
Preconfigured OAuthProviders go hereā€¦
dropbox fun OAuthProvider.Companion.dropbox(client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence): OAuthProvider
gitHub fun OAuthProvider.Companion.gitHub(client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence, scopes: List<String> = listOf("user")): OAuthProvider
google fun OAuthProvider.Companion.google(client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence, scopes: List<String> = listOf("openid")): OAuthProvider
soundCloud fun OAuthProvider.Companion.soundCloud(client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence): OAuthProvider