Global

Members

(readonly) AuthChallenge

Properties:
Name Type Attributes Description
UserName String

Saved user name or user input

Password String

Saved password or user input

IdentityDomain String <optional>

Saved identity domain or user input

Error Error <optional>

Any error with previous login attempt

Deprecated:
Source:

(readonly) BrowserMode

Properties:
Name Type Description
External string

Browser mode is external. An external browser will be opened.

Embedded string

Browser mode is embedded. An embedded browser will be opened within the app.

Deprecated:
Source:

(readonly) ConnectivityModes

Properties:
Name Type Description
Online string

Connectivity mode is online

Offline string

Connectivity mode is offline

Auto string

Connectivity mode is auto

Deprecated:
Source:

(readonly) Error

Deprecated: Use AuthError

Properties:
Name Type Attributes Description
ErrorCode String

Error code as defined in the plugin documentation or system error code only in case of iOS.

ErrorSource ErrorSource

Source of the error.

TranslatedErrorMessage String <optional>

Available in case of System error messages only for iOS.

Deprecated:
Source:

(readonly) ErrorSource

Enum values for Error#ErrorSource.

Properties:
Name Type Description
Plugin string

Source of the error is plugin.

System string

Source of the error is system.

Source:

(readonly) ErrorSources

Deprecated: Use ErrorSource.

Properties:
Name Type Description
Plugin string

Source of the error is plugin.

System string

Source of the error is system.

Deprecated:
Source:

(readonly) OAuthAuthorizationGrantTypes

Properties:
Name Type Description
OAuthImplicit string

OAuth grant type is implicit

OAuthAuthorizationCode string

OAuth grant type is authorization code

OAuthResourceOwner string

OAuth grant type is resource owner

OAuthClientCredentials string

OAuth grant type is client credentials

Deprecated:
Source:

(readonly) TimeoutResponse

Properties:
Name Type Description
TimeoutType TimeoutType

Type of timeout.

TimeLeftToTimeout String

Time in seconds after which timeout will happen.

Deprecated:
Source:

(readonly) TimeoutType

Properties:
Name Type Description
SessionTimeout string

Timeout type is session timeout

IdleTimeout string

Timeout type is idle timeout

Deprecated:
Source:

Methods

init(authProps) → {Promise.<AuthenticationFlow>}

Starting point for creating an AuthenticationFlow instance. Example usage:

var authProps = new cordova.plugins.IdmAuthFlows.HttpBasicAuthPropertiesBuilder()
                    ...
                    ...
                    .build();
var initPromise = cordova.plugins.IdmAuthFlows.init(authProps);
initPromise.then(...).catch(...)
Parameters:
Name Type Description
authProps Object

An object containing configuration for authentication constructed using one of the builder sub classes provided.

Source:
Returns:

Promise is resolved with a subclass of AuthenticationFlow depending on the type of authentication being inited:

If the promise is rejected, the callback will receive and object of type AuthError
Type
Promise.<AuthenticationFlow>

newFedAuthPropertiesBuilder() → {FedAuthPropertiesBuilder}

Deprecated: Use new FedAuthPropertiesBuilder

The object returned is a builder which can be used to create the authentication props for FederatedAuthentication. Builder exposes methods to add properties relevant to FederatedAuthentication. Example usage:

  var authProps = IdmAuthFlows.newFedAuthPropertiesBuilder('appName', 'http://login/url', 'http://logout/url',
                                                           'http://login/success', 'http://logout/failed')
    .logoutSuccessURL('http://logout/success')
    .logoutFailureUrl('http://logout/failed')
    .confirmLogoutAutomatically(true)
    .confirmLogoutButtonId('buttonId')
    .sessionTimeOutInSeconds(6000)
    .logoutTimeOutInSeconds(60)
    .customAuthHeaders({'header':'value'})
    .put('customKey1', 'customValue1')
    .put('customKey2', true)
    .build();
Deprecated:
  • Use new FedAuthPropertiesBuilder
Source:
Returns:
Type
FedAuthPropertiesBuilder

newHttpBasicAuthPropertiesBuilder() → {HttpBasicAuthPropertiesBuilder}

Deprecated: Use new HttpBasicAuthPropertiesBuilder

The object returned is a builder which can be used to create the authentication props for HttpBasicAuthentication. Builder exposes methods to add properties relevant to HttpBasicAuthentication. Example usage:

   var authProps = IdmAuthFlows.newHttpBasicAuthPropertiesBuilder('appName',
               'http://loginUrl',
               'http://logoutUrl')
    .idleTimeOutInSeconds(300)
    .sessionTimeOutInSeconds(6000)
    .percentageToIdleTimeout(80)
    .maxLoginAttempts(2)
    .connectivityMode(IdmAuthFlows.ConnectivityMode.Offline)
    .offlineAuthAllowed(true)
    .customAuthHeaders({'a':'b'})
    .rememberUsernameAllowed(true)
    .rememberCredentialsAllowed(false)
    .autoLoginAllowed(false)
    .rememberUsernameDefault(true)
    .rememberCredentialDefault(true)
    .autoLoginDefault(false)
    .put('customKey1', 'customValue1')
    .put('customKey2', true)
    .build();
Deprecated:
  • Use new HttpBasicAuthPropertiesBuilder
Source:
Returns:
Type
HttpBasicAuthPropertiesBuilder

newOAuthPropertiesBuilder() → {OAuthPropertiesBuilder}

Deprecated: Use new OAuthPropertiesBuilder

The object returned is a builder which can be used to create the authentication props for OAuthAuthentication. Builder exposes methods to add properties relevant to OAuthAuthentication. Example usage:

  var authProps = IdmAuthFlows.newOAuthPropertiesBuilder('appName',
                                                         IdmAuthFlows.OAuthAuthorizationGrantType.OAuthResourceOwner,
                                                         'http://token/endpoint',
                                                         'clientId')
    .oAuthScope(['scope1', 'scope2'])
    .oAuthClientSecret('clientSecret')
    .oAuthAuthorizationEndpoint('http://auth/endpoint')
    .oAuthRedirectEndpoint('http://redirect/endpoint')
    .logoutURL('http://logout/url')
    .browserMode(IdmAuthFlows.BrowserMode.External)
    .logoutTimeOutInSeconds(60)
    .customAuthHeaders({'header':'value'})
    .put('customKey1', 'customValue1')
    .put('customKey2', true)
    .build();
Deprecated:
  • Use new OAuthPropertiesBuilder
Source:
Returns:
Type
OAuthPropertiesBuilder

newOpenIDConnectPropertiesBuilder() → {OpenIDConnectPropertiesBuilder}

Deprecated: Use new OpenIDConnectPropertiesBuilder

The object returned is a builder which can be used to create the authentication props for OpenIdConnect. Builder exposes methods to add properties relevant to OpenId Connect authentication. Example usage:

  var authProps = IdmAuthFlows.newOpenIDConnectPropertiesBuilder('appName',
                                                         IdmAuthFlows.OAuthAuthorizationGrantType.OAuthResourceOwner,
                                                         'http://openid/discovery/url',
                                                         'clientId')
    .oAuthClientSecret('clientSecret')
    .oAuthScope(['scope1', 'scope2'])
    .browserMode(IdmAuthFlows.BrowserMode.External)
    .logoutTimeOutInSeconds(60)
    .customAuthHeaders({'header':'value'})
    .put('customKey1', 'customValue1')
    .put('customKey2', true)
    .build();
Deprecated:
  • Use new OpenIDConnectPropertiesBuilder
Source:
Returns:
Type
OpenIDConnectPropertiesBuilder

Type Definitions

AuthError

Error object passed to the callback with a Promise is rejected.

Type:
  • Object
Properties:
Name Type Attributes Description
errorCode String

Error code as defined in the plugin documentation or system error code only in case of iOS.

errorSource ErrorSource

Source of the error.

translatedErrorMessage String <optional>

Available in case of System error messages only for iOS.

Source: