Class: HttpBasicAuthPropertiesBuilder

HttpBasicAuthPropertiesBuilder(appName, loginUrl, logoutUrl)

This class is the builder for HTTP Basic Authentication. Using this builder to init an authentication flow will return HttpBasicAuthenticationFlow in the init promise.

In this type of authentication, while logging in, user will be challenged to provide credentials and preferences. At this time challenge callback provided by app will get invoked. App should collect these from the user and pass it back. See remote authentication challenge callback documentation for details. In addition, app can attach timeout callback to handle authentication timeouts.

Constructor

new HttpBasicAuthPropertiesBuilder(appName, loginUrl, logoutUrl)

Parameters:
Name Type Description
appName string

Application name

loginUrl string

Basic auth login end point.

logoutUrl string

Basic auth logout end point.

Source:

Extends

Members

(static, readonly) ConnectivityMode

Properties:
Name Type Description
Online string

Connectivity mode is online

Offline string

Connectivity mode is offline

Auto string

Connectivity mode is auto

Source:

Methods

appName(appName) → {RemoteAuthPropertiesBuilder}

Parameters:
Name Type Description
appName String

Application name

Inherited From:
Source:
Returns:
Type
RemoteAuthPropertiesBuilder

autoLoginAllowed(allowed) → {HttpBasicAuthPropertiesBuilder}

This method is for specifying if user is allowed to configure automatic login preference or not. This allows app to control what the user can do in the login screen. If this is set to 'true' value set in HttpBasicAuthPropertiesBuilder#autoLoginDefault will be returned in the challenge for auto login preference. This feature enables user to login without challenge, after first successful login, until session times out or user logs out.

Parameters:
Name Type Description
allowed boolean

if user can be allowed to change the preference for auto login.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

autoLoginDefault(allowed) → {HttpBasicAuthPropertiesBuilder}

This method sets the default value for automatic login preference. This preference is applicable only when {HttpBasicAuthPropertiesBuilder#autoLoginAllowed} is true

Parameters:
Name Type Description
allowed boolean

default value for auto login preference.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

build() → {Object}

Overrides:
Source:
Returns:

validate and return properties collected.

Type
Object

challengeCallback(callback) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
callback RemoteAuthPropertiesBuilder~remoteAuthChallengeCallback

Callback to handle credential challenge.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

collectIdentityDomain(collect) → {HttpBasicAuthPropertiesBuilder}

This is to specify if the user challenge should contain identity domain or not. Defaults to false.

Parameters:
Name Type Description
collect boolean

true to collect identity domain when user is challenged.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

connectivityMode(mode) → {HttpBasicAuthPropertiesBuilder}

This has effect only when HttpBasicAuthPropertiesBuilder#offlineAuthAllowed is set to 'true'. When set to 'false' will result in an Online login always.

Parameters:
Name Type Description
mode HttpBasicAuthPropertiesBuilder.ConnectivityMode

connectivity mode to be used

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

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()

Inherited From:
Source:
Returns:
Type
RemoteAuthPropertiesBuilder

identityDomainHeaderName(headerName) → {HttpBasicAuthPropertiesBuilder}

Works only when HttpBasicAuthPropertiesBuilder#passIdentityDomainNameInHeader is set to true. Default value is X-USER-IDENTITY-DOMAIN-NAME.

Parameters:
Name Type Description
headerName string

header name to be used.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

idleTimeOutInSeconds(timeout) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
timeout number

seconds after which which idle timeout should kick in when user is idle. After these many seconds timeout callback will be invoked. Note: 'Idle' is not tied to app usage yet. It is based on IDM isValid API invocation.

Overrides:
Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

loginUrl(url) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
url string

Basic auth login end point.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

logoutTimeOutInSeconds(timeout) → {RemoteAuthPropertiesBuilder}

Parameters:
Name Type Description
timeout number

specifiy timeout before which ongoing logout attempt will be aborted.

Inherited From:
Source:
Returns:
Type
RemoteAuthPropertiesBuilder

logoutUrl(url) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
url string

Basic auth logout end point.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

maxLoginAttempts(attempts) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
attempts number

maximum login attempts

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

offlineAuthAllowed(allowed) → {HttpBasicAuthPropertiesBuilder}

Defaults to true. In general, apps want to retrieve headers for secured resource access. Apps can set this to false if they do not want the functionality.

Setting this to true results in credentials being stored offline in secured storage. App will be authenticated against this, when Offline login applies.

No matter what HttpBasicAuthPropertiesBuilder.ConnectivityMode is set, first time login will always be ONLINE. Offline credentials will be cleared if user exceeds the HttpBasicAuthPropertiesBuilder#maxLoginAttempts while logging in.

Note: RemoteAuthenticationFlow#getHeaders API depends on this to be able to retrieve the Authorization headers.

Parameters:
Name Type Description
allowed boolean

if offline auth is allowed or not. Defaults to 'true'.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

passIdentityDomainNameInHeader(pass) → {HttpBasicAuthPropertiesBuilder}

This is to specify whether identity domain is sent as header value as per HttpBasicAuthPropertiesBuilder#identityDomainHeaderName, when set to true, or should be prepended with the user name as identity_domain_name.user_name, when set to false. Default value is false.

Parameters:
Name Type Description
pass boolean

true to pass identity domain in header

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

percentageToIdleTimeout(percentage) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
percentage number

percentage of idle timeout before which timeout callback should be invoked. This can be used to alerted user about the upcoming idle timeout in timeout callback

Overrides:
Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

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

rememberCredentialDefault(allowed) → {HttpBasicAuthPropertiesBuilder}

This method sets the default value for remember credentials preference. This preference is applicable only when {HttpBasicAuthPropertiesBuilder#rememberCredentialsAllowed} is true

Parameters:
Name Type Description
allowed boolean

default value for remember credential preference.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

rememberCredentialsAllowed(allowed) → {HttpBasicAuthPropertiesBuilder}

This method is for specifying if user is allowed to configure remember credentials preference or not. This allows app to control what the user can do in the login screen. If this is set to 'true' value set in HttpBasicAuthPropertiesBuilder#rememberCredentialDefault will be returned in the challenge for remember password preference.

Parameters:
Name Type Description
allowed boolean

if user can be allowed to change the preference for remembering credential.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

rememberUsernameAllowed(allowed) → {HttpBasicAuthPropertiesBuilder}

This method is for specifying if user is allowed to configure remember user preference or not. This allows app to control what the user can do in the login screen. If this is set to 'true' value set in HttpBasicAuthPropertiesBuilder#rememberUsernameDefault will be returned in the challenge for remember user preference.

Parameters:
Name Type Description
allowed boolean

if user can be allowed to change the preference for remembering user name .

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

rememberUsernameDefault(allowed) → {HttpBasicAuthPropertiesBuilder}

This method sets the default value for remember user preference. This preference is applicable only when {HttpBasicAuthPropertiesBuilder#rememberUsernameAllowed} is true

Parameters:
Name Type Description
allowed boolean

default value for remember username preference.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

sessionTimeOutInSeconds(timeout) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
timeout number

seconds after which which session timeout should kick in. After these many seconds timeout callback will be invoked.

Overrides:
Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

timeoutCallback(callback) → {HttpBasicAuthPropertiesBuilder}

Parameters:
Name Type Description
callback RemoteAuthPropertiesBuilder~timeoutCallback

Callback to handle timeout notifications.

Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder