OAuthToken

public struct OAuthToken : Sendable, Equatable

An OAuth access token and its expiry, returned by the token delegate for the implicit OAuth flow.

Returned from the listener registered via setTokenDelegateListener(_:) so the SDK can both use the token for the connection and track when it expires to request a fresh one in time.

Properties

  • The raw JWT / access token string obtained from the OAuth provider.

    Declaration

    Swift

    public let accessToken: String
  • The absolute time at which accessToken expires.

    The SDK uses this value to request a fresh token shortly before the current one expires — the proactive refresh that keeps the implicit-flow session alive. The expiry is required so proactive refresh always functions; a token whose expiry is unknown would silently opt out of it.

    Declaration

    Swift

    public let expiresAt: Date

Init

  • Creates an OAuth token.

    Declaration

    Swift

    public init(accessToken: String, expiresAt: Date)

    Parameters

    accessToken

    The raw JWT / access token string.

    expiresAt

    The absolute expiry time of the token.