@sudoplatform/sudo-user
    Preparing search index...

    Class DefaultSudoUserClient

    Interface encapsulating a library of functions for calling Sudo Platform identity service, handling federated sign in, managing keys and performing cryptographic operations.

    Implements

    Index

    Constructors

    Accessors

    Methods

    • Returns the subject of the user associated with this client. Note: This is an internal method used by other Sudo platform SDKs.

      Returns Promise<string | undefined>

      user subject.

    • Returns the user name associated with this client. The username maybe needed to contact the support team when diagnosing an issue related to a specific user.

      Returns Promise<string | undefined>

      user name.

    • Indicates whether or not this client is signed in with Sudo Platform backend. The client is considered signed in if it cached valid ID, access and refresh tokens.

      Returns Promise<boolean>

      true if the client is signed in.

    • Presents the Cognito hosted UI signout endpoint. When the endpoint is invoked, the hosted web app's cookies will be invalidated, but the user is not logged out of Cognito.

      Returns void

    • Registers this client against the backend with an external authentication provider. The caller must implement AuthenticationProvider protocol to return the appropriate authentication token required to authorize the registration request.

      Parameters

      • authenticationProvider: AuthenticationProvider

        authentication provider that provides the authentication token.

      • OptionalregistrationId: string

        registration ID to uniquely identify this registration request.

      Returns Promise<string>

      user ID of the newly created user

    • Provide a custom authentication store. This is mainly used for unit testing (optional).

      Parameters

      • authenticationStore: AuthenticationStore

      Returns void

    • Provide a custom auth UI. This is mainly used for unit testing (optional).

      Parameters

      • authUI: AuthUI

      Returns void

    • Provide a custom identity provider. This is mainly used for unit testing (optional).

      Parameters

      • identityProvider: IdentityProvider

      Returns void

    • Provide a custom function to open the sign in url. This is mainly used for unit testing (optional).

      Parameters

      • launchUriFn: (url: string) => void

      Returns void