User

public protocol User : Sendable

Protocol for a User. Provides methods for token management, user information retrieval, and logout.

  • token() Asynchronous

    Retrieves the token for the user.

    Declaration

    Swift

    func token() async -> Result<Token, OidcError>

    Return Value

    A Result object containing either the Token or an OidcError.

  • revoke() Asynchronous

    Revokes the user’s token.

    Declaration

    Swift

    func revoke() async
  • userinfo(cache:) Asynchronous

    Retrieves the user’s information.

    Declaration

    Swift

    func userinfo(cache: Bool) async -> Result<UserInfo, OidcError>

    Parameters

    cache

    Whether to cache the user information.

    Return Value

    A Result object containing either the user information as a UserInfo or an OidcError.

  • logout() Asynchronous

    Logs out the user.

    Declaration

    Swift

    func logout() async