- Source:
Extends
Methods
getManager() → {LocalAuthenticationFlowManager}
Returns the local auth manager associated with this flow.
- Source:
Returns:
isAuthenticated() → {Promise.<boolean>}
This method is used for checking if the user is authenticated or not.
- Overrides:
- Source:
Returns:
- Type
- Promise.<boolean>
login() → {Promise.<AuthenticationFlow>}
This method is used to login.
The promise is resolved when login succeeds. The user can be redirected to the app once this happens.
The promise gets rejected with an AuthError object which contains information on the reason of failure. This information can be used to shown the reason why login did not succeed. App keep track of these failures and implement specific policies related to maximum attempts and steps to do after multiple failures here.
Sample usage:
cordova.plugins.IdmAuthFlows.init(authProps).then( function(authenticationFlow) { var loginPromise = authenticationFlow.login(); loginPromise.then(...); loginPromise.catch(...); } );
In case of PIN authentication, PIN challenge callback will be invoked. App should show UI for collecting PIN from the user and pass it back to the plugin via callback as explained in LocalAuthPropertiesBuilder documentation.
In case of fingerprint or biometric based local authentication, the device native UI for collecting biometric will be provided to the user. This UI can be customized by the app as explained in LocalAuthPropertiesBuilder documentation. User will have a way to fall back on to PIN based authentication as per device policies. In this case the PIN authentication flow will kick in.
- Overrides:
- Source:
Returns:
If the promise is rejected, the callback will receive and object of type AuthError
- Type
- Promise.<AuthenticationFlow>
logout(purgeSettings) → {Promise.<AuthenticationFlow>}
Logout is a noop for local authentication. The promise returned resolves immediately.
Parameters:
Name | Type | Description |
---|---|---|
purgeSettings |
boolean | pass true to reset saved information for this auth. Not applicable in this case. |
- Overrides:
- Source:
Returns:
- Type
- Promise.<AuthenticationFlow>