Members
(static, constant) this.ANONYMOUS_USER
SID for ANONYMOUS user
- Source:
(static, constant) this.SYSTEM_USER
SID for SYSTEM USER
- Source:
Methods
(static) authorizationCodeLoginAsync(noSession) → {Promise}
Performs an OAUTH authorization code grant
Parameters:
Name | Type | Description |
---|---|---|
noSession |
boolean | When true, indicates that there should not be a persistent session created |
- Source:
- See:
Returns:
- Type
- Promise
(static) challengeLoginAsync(userName, challenge, response, tfaSecret) → {Promise}
Performs an extended login for the purpose of password reset (using a challenge and response)
Parameters:
Name | Type | Description |
---|---|---|
userName |
string | The name of the user which is logging in |
challenge |
string | The selected user challenge which is being answered |
response |
string | The user's response to the challenge offerred |
tfaSecret |
string | The two-factor secret if provided |
- Source:
- See:
Returns:
- Type
- Promise
(static) clientCredentialLoginAsync(noSession, scope) → {Promise}
Performs an OAUTH client credentials login
Parameters:
Name | Type | Description |
---|---|---|
noSession |
boolean | When true, indicates that a session should not be replaced that the request is a one time use token |
scope |
Array | The list of scopes for this session |
- Source:
- See:
Returns:
- Type
- Promise
(static) demandAsync(policy) → {Promise}
Demand permission for the specified policy
Parameters:
Name | Type | Description |
---|---|---|
policy |
string | The policy which is being demanded |
- Source:
Returns:
- Type
- Promise
(static) getSessionInfoAsync(forceServer) → {Promise}
Gets the extended session information
Parameters:
Name | Type | Description |
---|---|---|
forceServer |
boolean | When true (or supplied) instructs the function to force a server fetch of the session |
- Source:
Returns:
- Type
- Promise
(static) getTfaModesAsync(upstream) → {Promise}
Retrieves information about the two-factor authentication modes supported by the server
Parameters:
Name | Type | Description |
---|---|---|
upstream |
boolean | True if the request should be forwarded to the upstream |
- Source:
Returns:
- Type
- Promise
(static) logoutAsync() → {Promise}
Abandons the current SanteDB session
- Source:
Returns:
- Type
- Promise
(static) passwordLoginAsync(userName, password, tfaSecret, scope, uacPrompt, purposeOfUse, claims) → {Promise}
Performs a OAUTH password login
Parameters:
Name | Type | Description |
---|---|---|
userName |
string | The name of the user which is logging in |
password |
string | The password of the user |
tfaSecret |
string | The two-factor secret if provided |
scope |
string | When true indicates that there should not be a persistent session (i.e. one time authentication) |
uacPrompt |
boolean | True if the authentication is part of a UAC prompt and no perminant session is to be |
purposeOfUse |
String | The identifier of the purpose of use for the access |
claims |
any | The claims which are to be appended to the OAUTH request |
- Source:
- See:
Returns:
- Type
- Promise
(static) pinLoginAsync(userName, password, tfaSecret, noSession, purposeOfUse, scope) → {Promise}
Performs a local pin login
Parameters:
Name | Type | Description |
---|---|---|
userName |
string | The name of the user which is logging in |
password |
string | The password of the user |
tfaSecret |
string | The two-factor secret if provided |
noSession |
boolean | When true indicates that there should not be a persistent session (i.e. one time authentication) |
purposeOfUse |
String | The reason the authentication is happening |
scope |
Array | The requested scope of the session |
- Source:
- See:
Returns:
- Type
- Promise
(static) refreshLoginAsync(noSession) → {Promise}
Performs a refresh token grant
Parameters:
Name | Type | Description |
---|---|---|
noSession |
boolean | True if no session should be setup |
- Source:
- See:
Returns:
- Type
- Promise
(static) setElevator(elevator)
Sets the elevator function
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
elevator |
any | An elevation implementation
Properties
|
- Source:
(static) setPasswordAsync(sid, userName, passwd, upstream) → {Promise}
Sets the password of the specified user
Parameters:
Name | Type | Description |
---|---|---|
sid |
string | The security identifier of the user which is being updated |
userName |
string | The name of the user to set the password to |
passwd |
string | The password to set the currently logged in user to |
upstream |
bool | True if the request should be routed to the upstream |
- Source:
Returns:
- Type
- Promise
(static) setupTfaSecretAsync(mechanism, code, upstream) → {Promise}
Initiates the setup of a TFA secret for the current user
Parameters:
Name | Type | Description |
---|---|---|
mechanism |
string | The mode of two-factor authentication (email, sms, etc.) |
code |
string | When specified, the validation code to complete the setup |
upstream |
boolean | True if the request should be executed upstream |
- Source:
Returns:
- Type
- Promise
(static) this.expirePasswordAsync(sid, userName, upstream)
Immediately expire the user's password
Parameters:
Name | Type | Description |
---|---|---|
sid |
string | The security user for which the password should be expired |
userName |
string | The name of the user which is to be expired |
upstream |
bool | True if the request should be sent to the upstream |
- Source:
(static) this.getCurrentFacilityId() → {String}
Gets the current CDR facility identifier from either (1) the user's session assertion (the facility the user is assigned to and/or selected on login) or (2) the configured facility
- Source:
Returns:
- Type
- String
(static) this.getCurrentUserEntityId() → {String}
Get the currently logged in user's CDR entity id
- Source:
Returns:
- Type
- String