Skip to main content
Version: Next

Auth

A static class that gathers all the required methods to handle the authentication and sessions with Olympe.

Index

Constructors

constructor

Methods

staticgenerateSRPData

  • generateSRPData(username: string, password: string): SRPData
  • Based on the username and password, it generates a salt and verifier to configure a SRP user


    Parameters

    • username: string
    • password: string

    Returns SRPData

staticgetCurrentUser

  • getCurrentUser(): string
  • Return the tag of the current authenticated user.


    Returns string

    The tag of the current user

staticgetIDPNames

  • getIDPNames(): string[]
  • Retrieve the IDP names that can be used for SSO login


    Returns string[]

staticgetIDPToken

  • getIDPToken(): string
  • Return the IDP token (zipped & base64 encoded XML) for the current user.


    Returns string

    The current IDP token

staticgetState

  • Return the current state of the authentication manager


    Returns AuthState

    the current state

staticgetToken

  • getToken(): string
  • Return the token currently used to identify the current session.


    Returns string

    The current token

staticgetUserFromToken

  • getUserFromToken(token: string): Promise<string>
  • Retrieve the user tag associated to the specified token


    Parameters

    • token: string

    Returns Promise<string>

staticloginOpenID

  • loginOpenID(): Promise<void>
  • Try to login using the configured OpenID Provider. Returns a promise resolved when logged in or that catches an error if the login is not valid.

    @deprecated

    use Auth.loginSSO instead

    @throws

    If the provider’s configuration is incorrect.


    Returns Promise<void>

staticloginSAML

  • loginSAML(): Promise<void>
  • Try to login using SAML protocol with the specified username and password. Returns a promise resolved when logged in or that catches an error if refused.

    @deprecated

    use Auth.loginSSO instead

    @throws

    If the provider’s configuration is incorrect.


    Returns Promise<void>

staticloginSRP

  • loginSRP(username: string, password: string): Promise<void>
  • Try to login using SRP protocol with the specified username and password. Returns a promise resolved when logged in or that catches an error if refused.

    @throws

    If the provider’s configuration is incorrect.


    Parameters

    • username: string

      the username

    • password: string

      the password

    Returns Promise<void>

staticloginSSO

  • loginSSO(idpName?: string): Promise<void>
  • Try to login using SSO. Returns a promise resolved when logged in or an error if the login is not valid.

    @throws

    If the IDP name is incorrect.


    Parameters

    • optionalidpName: string

      the IDP name which should be used. If not specified, take the first available SSO.

    Returns Promise<void>

staticloginToken

  • loginToken(username: string, token: string): Promise<void>
  • Try to login using the specified token for the user. Returns a promise resolved when logged in or that catches an error if the token is not valid.


    Parameters

    • username: string

      the username

    • token: string

      the token

    Returns Promise<void>

staticlogout

  • logout(): Promise<void>
  • Log out the current user and invalidate its session token. It returns a promise resolved when the operation is done.


    Returns Promise<void>

staticobserveUser

  • observeUser(context: Context): Observable<string>
  • Returns an Observable that is updated each time the user tag changes.


    Parameters

    Returns Observable<string>

    An Observable

staticsendKeepAlive

  • sendKeepAlive(): void
  • Refresh the session token to keep it alive.


    Returns void