Package-level declarations

Types

Link copied to clipboard

Plugin to interact with the Supabase Auth API

Link copied to clipboard

The configuration for Auth

The configuration for Auth

actual class AuthConfig

The configuration for Auth

The configuration for Auth

actual class AuthConfig

The configuration for Auth

The configuration for Auth

actual class AuthConfig

The configuration for Auth

Link copied to clipboard

The default values for the AuthConfig

Link copied to clipboard
class AuthenticatedSupabaseApi constructor(resolveUrl: (path: String) -> String, parseErrorResponse: suspend (response: HttpResponse) -> RestException? = null, defaultRequest: HttpRequestBuilder.() -> Unit? = null, supabaseClient: SupabaseClient, jwtToken: String? = null) : SupabaseApi
Link copied to clipboard

A cache for the code verifier used in the PKCE flow.

Link copied to clipboard
sealed interface ExternalAuthAction

Represents the available actions for external auth such as OAuth and SSO.

Link copied to clipboard

The type of login flow to use

Link copied to clipboard
data class HttpCallbackConfig(var httpPort: Int = 0, var timeout: Duration = 1.minutes, var htmlTitle: String = "Supabase Auth", var redirectHtml: String = HttpCallbackHtml.redirectPage("https://supabase.com/brand-assets/supabase-logo-icon.png", "Supabase Auth", "Logged in. You may continue in your app"))

Http callback configuration for the web server, when logging in with OAuth.

Link copied to clipboard
class MemoryCodeVerifierCache(codeVerifier: String? = null) : CodeVerifierCache

A CodeVerifierCache that uses the AtomicRef API.

Link copied to clipboard

A SessionManager that uses the AtomicRef API.

Link copied to clipboard
sealed interface OtpType

OTPs (One Time Passwords) are used to authenticate users via email or phone.

Link copied to clipboard

Used to mark Postgrest filter DSL functions

Link copied to clipboard
interface SessionManager

Represents the session manager. Used for saving and restoring the session from storage

Link copied to clipboard
class SettingsCodeVerifierCache(settings: Settings = createDefaultSettings(), key: String = SETTINGS_KEY) : CodeVerifierCache

A CodeVerifierCache that uses the Settings API.

Link copied to clipboard
class SettingsSessionManager(settings: Settings = createDefaultSettings(), key: String = SETTINGS_KEY, json: Json = settingsJson) : SessionManager

A SessionManager that uses the Settings API.

Link copied to clipboard

Represents the scope of a sign-out action.

Properties

Link copied to clipboard

The Auth plugin handles everything related to Supabase's authentication system

Link copied to clipboard

The deeplink used for the implicit and PKCE flow. Throws an IllegalArgumentException, if either the scheme or host is not set

Link copied to clipboard

The deeplink used for the implicit and PKCE flow. Returns null, if either the scheme or host is not set

Functions

Link copied to clipboard
fun SupabaseClient.authenticatedSupabaseApi(plugin: MainPlugin<*>, defaultRequest: HttpRequestBuilder.() -> Unit? = null): AuthenticatedSupabaseApi

Creates a AuthenticatedSupabaseApi for the given plugin. Requires Auth to authenticate requests All requests will be resolved using the MainPlugin.resolveUrl function

fun SupabaseClient.authenticatedSupabaseApi(baseUrl: String, parseErrorResponse: suspend (response: HttpResponse) -> RestException? = null): AuthenticatedSupabaseApi

Creates a AuthenticatedSupabaseApi with the given baseUrl. Requires Auth to authenticate requests All requests will be resolved relative to this url

fun SupabaseClient.authenticatedSupabaseApi(resolveUrl: (path: String) -> String, parseErrorResponse: suspend (response: HttpResponse) -> RestException? = null, defaultRequest: HttpRequestBuilder.() -> Unit? = null, jwtToken: String? = null): AuthenticatedSupabaseApi

Creates a AuthenticatedSupabaseApi with the given resolveUrl function. Requires Auth to authenticate requests All requests will be resolved using this function

Link copied to clipboard
fun createDefaultSettings(): Settings
Link copied to clipboard
Link copied to clipboard
fun SupabaseClient.handleDeeplinks(intent: Intent, onSessionSuccess: (UserSession) -> Unit = {})

Handle deeplinks for authentication. This handles the deeplinks for implicit and PKCE flow.

fun SupabaseClient.handleDeeplinks(url: NSURL, onSessionSuccess: (UserSession) -> Unit = {})

Handle deeplinks for authentication. This handles the deeplinks for the implicit and the PKCE flow.

Link copied to clipboard
fun AuthConfigDefaults.minimalSettings(alwaysAutoRefresh: Boolean = false, autoLoadFromStorage: Boolean = false, autoSaveToStorage: Boolean = false, sessionManager: SessionManager? = MemorySessionManager(), codeVerifierCache: CodeVerifierCache? = MemoryCodeVerifierCache(), enableLifecycleCallbacks: Boolean = false)

Applies minimal settings to the AuthConfig. This is useful for server side applications, where you don't need to store the session or code verifier.

Link copied to clipboard
fun Auth.parseFragmentAndImportSession(fragment: String, onSessionSuccess: (UserSession) -> Unit = {})
Link copied to clipboard

Parses a session from a fragment.

Link copied to clipboard

Parses a session from an url.

Link copied to clipboard
fun HttpRequestBuilder.redirectTo(url: String)
Link copied to clipboard
suspend fun <C : MainConfig> SupabaseClient.resolveAccessToken(plugin: MainPlugin<C>, keyAsFallback: Boolean = true): String?
suspend fun SupabaseClient.resolveAccessToken(jwtToken: String? = null, keyAsFallback: Boolean = true): String?

Returns the access token used for requests. The token is resolved in the following order:

Link copied to clipboard
expect fun Auth.setupPlatform()
actual fun Auth.setupPlatform()
actual fun Auth.setupPlatform()
actual fun Auth.setupPlatform()
actual fun Auth.setupPlatform()
actual fun Auth.setupPlatform()
Link copied to clipboard
inline suspend fun <T : Any> Auth.signInAnonymously(data: T, captchaToken: String? = null)

Signs in the user without any credentials. This will create a new user session with a new access token.