Auth
Index
Constructors
constructor
Returns Auth
Methods
staticgenerateSRPData
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
Return the tag of the current authenticated user.
Returns string
The tag of the current user
staticgetIDPNames
Retrieve the IDP names that can be used for SSO login
Returns string[]
staticgetIDPToken
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
Return the token currently used to identify the current session.
Returns string
The current token
staticgetUserFromToken
Retrieve the user tag associated to the specified token
Parameters
token: string
Returns Promise<string>
staticgetUserToken
Returns the full token of the current user. It contains:
- the username, the unique ID of the user for the IDP used
- the tag of the user in the datacloud
- the protocol and IDP used
- the raw payload sent by the IDP (eg: JWT for OAuth2 or SAML response).
Returns UserToken
staticloginOpenID
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.
Returns Promise<void>
staticloginSAML
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.
Returns Promise<void>
staticloginSRP
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.
Parameters
username: string
the username
password: string
the password
Returns Promise<void>
staticloginSSO
Try to login using SSO. Returns a promise resolved when logged in or an error if the login is not valid.
Parameters
optionalidpName: string
the IDP name which should be used. If not specified, take the first available SSO.
Returns Promise<void>
staticloginToken
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
Log out the current user and invalidate its session token. It returns a promise resolved when the operation is done.
Returns Promise<void>
staticobserveUser
Returns an
Observable
that is updated each time the user tag changes.Parameters
context: Context
The brick context
Returns Observable<string>
An
Observable
staticrefreshToken
Refresh the expiration time for the current authentication token. In case of OAuth2 authentication, it uses the refresh token associated to generate a new access token.
Returns Promise<void>
Promise success when the refresh is done
staticsendKeepAlive
Refresh the session token to keep it alive.
Returns void
A static class that gathers all the required methods to handle the authentication and sessions with Olympe.