Constructor
(abstract) new RemoteAuthPropertiesBuilder(appName)
Parameters:
Name | Type | Description |
---|---|---|
appName |
string | Application name |
- Source:
Extends
Members
(static, readonly) TimeoutType
Possible values for RemoteAuthPropertiesBuilder.TimeoutResponse.TimeoutType
Properties:
Name | Type | Description |
---|---|---|
SessionTimeout |
string | Timeout type is session timeout |
IdleTimeout |
string | Timeout type is idle timeout |
- Source:
Methods
appName(appName) → {RemoteAuthPropertiesBuilder}
Parameters:
Name | Type | Description |
---|---|---|
appName |
String | Application name |
- Source:
Returns:
build() → {Object}
- Overrides:
- Source:
Returns:
validate and return properties collected.
- Type
- Object
customAuthHeaders(headers) → {RemoteAuthPropertiesBuilder}
Parameters:
Name | Type | Description |
---|---|---|
headers |
Object.<string, string> | any custom headers. These are returned along with other authentication headers in RemoteAuthenticationFlow#getHeaders() |
- Source:
Returns:
idleTimeOutInSeconds(timeout) → {RemoteAuthPropertiesBuilder}
Deprecated: This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | seconds after which which idle timeout should kick in when user is idle. |
- Deprecated:
- This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
- Source:
Returns:
logoutTimeOutInSeconds(timeout) → {RemoteAuthPropertiesBuilder}
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | specifiy timeout before which ongoing logout attempt will be aborted. |
- Source:
Returns:
percentageToIdleTimeout(percentage) → {RemoteAuthPropertiesBuilder}
Deprecated: This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
Parameters:
Name | Type | Description |
---|---|---|
percentage |
number | percentage of idle timeout before which timeout callback should be invoked. |
- Deprecated:
- This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
- Source:
Returns:
put(key, value) → {Builder}
Convenience method to add key value pairs of auth settings to properties.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Authentication property key |
value |
string | Authentication property value |
- Inherited From:
- Source:
Returns:
- Type
- Builder
sessionTimeOutInSeconds(timeout) → {RemoteAuthPropertiesBuilder}
Deprecated: This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | seconds after which which session timeout should kick in. |
- Deprecated:
- This is not applicable for all remote authentications. Use method available in builder subclasses where applicable.
- Source:
Returns:
Type Definitions
AuthChallenge
Challenge object passed in remote challenge callback
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
username_key |
String | This is the username. When challenged: Populated with saved username if any. App should use this value to display on the login screen. Typically this is a text field on the UI. When submitting: Should contain user input when submitting the challenge using submit callback. |
|
password_key |
String | This is the password. When challenged: Populated with saved password if any. App should use this value to display on the login screen. Typically this is a password field on the UI. When submitting: Should contain user input when submitting the challenge using submit callback. |
|
CollectIdentityDomain |
boolean | This is a read only property. This will indicate if app should collect identity domain from user or not. |
|
iddomain_key |
String |
<optional> |
This is the identity domain. When challenged: Populated with saved identity domain if any. This is an optional field. App should use this value to display on the login screen. Typically this is a text field on the UI. App should not showing this field if this key is missing in the challenge object. When submitting: Should contain user input when submitting the challenge using submit callback. |
error |
AuthError |
<optional> |
This is an error object. When challenged: Populated with any error associated with previous login attempt. This is available only when previous login attempt failed the user is re-challenged. Typically used to display error message to the user. When submitting: This need not be set when submitting the challenge using submit callback. |
RememberUsernameAllowed |
boolean | This is a read only property. This will indicate if remember username feature is enabled or not. App can decide to show this option to the user on the login screen depending on the value. |
|
remember_username_ui_preference_key |
boolean |
<optional> |
This is a user preference to say if the user wants app to remember the username or not. When challenged: Populated with saved preference if any. This field is available only if allow remember user is set to true in the configuration. The value of this will be driven by remember user default value. Typically collected using a checkbox. App should not showing this field if this key is missing in the challenge object. It means allow remember user is set to false in the configuration. When submitting: User can modify this value and modified value should be part of the challenge when submitting using submit callback. User provided value will have precedence over remember user default value initially. |
RememberCredentialsAllowed |
boolean | This is a read only property. This will indicate if remember credentials feature is enabled or not. App can decide to show this option to the user on the login screen depending on the value. |
|
remember_credentials_ui_preference_key |
boolean |
<optional> |
This is a user preference to say if the user wants app to remember credentials or not. When challenged: Populated with saved preference if any. This field is available only if allow remember credentials is true in the configuration. The value of this will be driven by remember credentials default value initially. Typically collected using a checkbox. App should not showing this field if this key is missing in the challenge object. It means allow remember credentials is set to false in the configuration. When submitting: User can modify this value and modified value should be part of the challenge when submitting using submit callback. User provided value will have precedence over remember credentials default value. |
AutoLoginAllowed |
boolean | This is a read only property. This will indicate if auto login is enabled or not. App can decide to show this option to the user on the login screen depending on the value. |
|
autoLogin_ui_preference_key |
boolean |
<optional> |
This is a user preference to say if the user wants app to automatically login the user or not. When challenged: Populated with saved preference if any. This field is available only if allow auto login is set to true in the configuration. The value of this will be driven by auto login default value initially. Typically collected using a checkbox. App should not showing this field if this key is missing in the challenge object. It means allow auto login is set to false in the configuration. When submitting: User can modify this value and modified value should be part of the challenge when submitting using submit callback. User provided value will have precedence over auto login default value. |
- Source:
challengeCancelCallback()
Authentication cancel callback. Used to cancel the challenge.
- Source:
remoteAuthChallengeCallback(challenge, challengeHandler)
This is the remote authentication challenge callback. This callback is invoked when there is a challenge to collect credentials from the user in some authentications such as HTTP basic auth and 2 legged OAuth. This callback should be implemented by app and set to the respective builder as the challenge callback.
In this callback app has to do the following:
On receiving this challenge, app should show a login screen to the user. Challenge object passed to this callback will contain any saved information, such as saved username or password or saved preferences for remember user, remember credentials, auto login etc. App should populate the login screen based on this information as explained in the challenge object documentation. Once user has provided the input, app should update the challenge object and invoke completion callback. If user wishes to cancel the login then app should invoke cancel callback. Both callbacks are passed to this as part of challenge handler
Parameters:
Name | Type | Description |
---|---|---|
challenge |
RemoteAuthPropertiesBuilder~AuthChallenge | Saved data if any and information to be collected from the user. |
challengeHandler |
RemoteAuthPropertiesBuilder~RemoteAuthChallengeHandler | To be used by app to either submit or cancel the challenge. |
- Source:
remoteAuthChallengeCompletionCallback(challenge)
Remote authentication challenge completion callback
Parameters:
Name | Type | Description |
---|---|---|
challenge |
RemoteAuthPropertiesBuilder~AuthChallenge | information collected from the user. |
- Source:
RemoteAuthChallengeHandler
Remote authentication challenge handler
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
submit |
RemoteAuthPropertiesBuilder~remoteAuthChallengeCompletionCallback | App invokes this passing user input to proceed with the current challenge. |
cancel |
RemoteAuthPropertiesBuilder~challengeCancelCallback | App invokes this to cancel the current challenge. |
- Source:
timeoutCallback(timeoutResponse)
This callback represents remote authentication timeout callback. This is invoked when a timeout occurs in certain type of authentications.
For HTTP basic auth this callback will be invoked in following conditions:
- Idle timeout with non zero time left to timeout - This happens when percentage to idle timeout is set to a non zero value. In this case, the timeout can be extended by invoking HttpBasicAuthenticationFlow#resetIdleTimeout.
- Idle timeout with zero time left to timeout - User has to be re-authenticated. The app has to invoke HttpBasicAuthenticationFlow#login. If auto login is allowed and enabled by user, login happens without challenge.
- Session timeout (time left to timeout will always be zero for this) - User has to be re-authenticated. The app has to invoke AuthenticationFlow#login. Auto login does not help here.
For Federated auth, there is only session timeout. User has to be re-authenticated. The app has to invoke AuthenticationFlow#login.
Parameters:
Name | Type | Description |
---|---|---|
timeoutResponse |
RemoteAuthPropertiesBuilder~TimeoutResponse |
- Source:
TimeoutResponse
Object passed in timeout callback
Properties:
Name | Type | Description |
---|---|---|
TimeoutType |
RemoteAuthPropertiesBuilder.TimeoutType | Type of timeout. |
TimeLeftToTimeout |
number | Time in seconds after which timeout will happen. |
- Source: