Skip to main content

Configuration

ThunderIDConfig is the configuration struct passed to ThunderIDClient.initialize(config:storage:) and to the .thunderIDProvider(config:) view modifier.

Example

import ThunderID

let config = ThunderIDConfig(
baseUrl: "https://localhost:8090",
clientId: "<your-client-id>",
scopes: ["openid", "profile", "email"],
afterSignInUrl: "io.thunderid.b2c://callback",
afterSignOutUrl: "io.thunderid.b2c://logout",
applicationId: "<your-application-id>"
)

Parameters

ParameterTypeDefaultDescription
baseUrlStringRequired. Your ThunderID instance URL. Must use HTTPS (e.g., https://localhost:8090).
clientIdString?nilThe Client ID from your ThunderID application. Required for redirect-based authentication and token operations.
scopes[String]["openid"]OAuth 2.0 scopes to request. Include "profile" and "email" to receive user identity claims.
afterSignInUrlString?nilThe redirect URI to return to after sign-in. Must match an Allowed Redirect URI registered in the console.
afterSignOutUrlString?nilThe redirect URI to return to after sign-out. Must match an Allowed Post-Logout Redirect URI in the console.
signInUrlString?nilOverride the sign-in URL. Defaults to the ThunderID hosted sign-in page.
signUpUrlString?nilOverride the sign-up URL.
clientSecretString?nilClient secret for confidential clients. Do not include this in a shipped iOS app.
signInOptions[String: Any][:]Additional query parameters appended to the authorization URL on sign-in.
signOutOptions[String: Any][:]Additional parameters sent with the sign-out request.
signUpOptions[String: Any][:]Additional parameters sent with the sign-up request.
applicationIdString?nilThe Application ID used for app-native (embedded) sign-in flows via the Flow Execution API.
organizationHandleString?nilThe organization handle for multi-tenant deployments.
tokenValidationTokenValidationConfigsee belowControls ID token validation behavior.
storageStorageAdapter?nilCustom token storage backend. Defaults to KeychainStorageAdapter.
instanceIdInt?nilIdentifies the SDK instance when running multiple instances in one process.

TokenValidationConfig

Controls how the SDK validates ID tokens.

ThunderIDConfig(
baseUrl: "https://localhost:8090",
clientId: "<your-client-id>",
tokenValidation: TokenValidationConfig(
validate: true,
validateIssuer: true,
clockTolerance: 30
)
)
ParameterTypeDefaultDescription
validateBooltrueWhether to validate ID token signatures and claims. Set to false only during local development.
validateIssuerBooltrueWhether to validate the iss claim against baseUrl.
clockToleranceInt0Allowed clock skew in seconds when validating token expiry.

Storage Backends

The SDK provides two built-in storage backends:

ClassDescription
KeychainStorageAdapterDefault. Persists tokens in the iOS Keychain, surviving app restarts.
InMemoryStorageAdapterStores tokens in memory only. Tokens are lost when the app is terminated. Useful for testing.

To use a custom backend, implement the StorageAdapter protocol:

public protocol StorageAdapter {
func get(key: String) -> String?
func set(key: String, value: String)
func remove(key: String)
}

Pass your implementation to ThunderIDConfig(storage:) or to ThunderIDClient.initialize(config:storage:).

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy