Agent

public protocol Agent<T> : Sendable

The Agent is a protocol that is used to authenticate and end a session with an OpenID Connect provider. T is the configuration object that is used to configure the Agent.

  • T

    Declaration

    Swift

    associatedtype T
  • Provides the configuration object for the Agent.

    Declaration

    Swift

    func config() -> () -> T

    Return Value

    A function that returns the configuration object.

  • End the session with the OpenID Connect provider. Best effort is made to end the session.

    Declaration

    Swift

    func endSession(oidcConfig: OidcConfig<T>, idToken: String) async throws -> Bool
  • authorize(oidcConfig:) Asynchronous

    Authorize the Agent with the OpenID Connect provider. Before returning the AuthCode, the agent should verify the response from the OpenID Connect provider. For example, the agent should verify the state parameter in the response.

    Declaration

    Swift

    func authorize(oidcConfig: OidcConfig<T>) async throws -> AuthCode

    Parameters

    oidcConfig

    The configuration for the OpenID Connect client.

    Return Value

    AuthCode instance