OidcWebClient

public extension OidcWebClient
  • Creates an OIDC login instance with the provided configuration block.

    Declaration

    Swift

    static func createOidcWebClient(block: @Sendable (OidcWebClientConfig) -> Void = {_ in }) -> OidcWebClient

    Parameters

    block

    A closure to configure the OIDC options.

    Return Value

    An instance of OidcWebClient configured for OIDC login.

  • Creates an OidcWebClient instance from a JSON dictionary.

    This factory parses and validates a platform-neutral JSON configuration and delegates to createOidcWebClient(block:) with the extracted values. Unknown fields are silently ignored for forward compatibility.

    Declaration

    Swift

    static func createOidcWebClient(json: [String : Any]) -> Result<OidcWebClient, Error>

    Parameters

    json

    A [String: Any] dictionary conforming to the unified SDK configuration schema (see design doc for field reference).

    Return Value

    .success(OidcWebClient) on valid input, .failure(JsonConfigError) if a required field is absent or a field has the wrong type.

  • authorize(configure:) Asynchronous

    This method initializes the OIDC client and starts the login process.

    Declaration

    Swift

    func authorize(configure: @Sendable (inout OidcOptions) -> Void = { _ in }) async throws -> Result<User, OidcError>

    Parameters

    configure

    A closure to configure the OIDC options.

    Return Value

    A Result containing the User or an OidcError.

  • user() Asynchronous

    Method to return the OIDC user. This method checks if the OIDC client is initialized and sets up the necessary configurations.

    Declaration

    Swift

    func user() async -> User?

    Return Value

    The user if found, otherwise nil.

  • oidcLoginUser() Asynchronous

    Alias for the Browser.user() method.

    Declaration

    Swift

    func oidcLoginUser() async -> User?

    Return Value

    The user if found, otherwise nil.