Namespace: Core

sap.Logon. Core

Methods

(static) activateSecureStoreForUser(successCallback(context,state):, errorCallback:, param:)

Method for activate the secure store for a particular user in multiuser mode. This happens when log-in the first user after restarting the app, or when switching to a different user from currrent user
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if unlocking succeeds;
errorCallback: this method will be called back if unlocking fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: object containing the passcode for key "unlockPasscode" and userid in currentSelectedUser.devcieUserId

(static) applyLocalPasscodePolicy(successCallbackopt, errorCallbackopt)

Apply the current local passcode policy. This function is intended to be invoked by the listener registered This function is needed for the case when the local passcode policy has changed, but the app does not need to be totally reset.
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>

(static) applyPasscodePolicy(successCallbackopt, errorCallbackopt)

Apply the current passcode policy. This function is intended to be invoked by the listener registered This function is needed for the case when the passcode policy has changed, but the app does not need to be totally reset.
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>

(static) cancelRegistration(successCallback(context,state):, errorCallback:)

Method for cancelling the registration.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if cancelling succeeds with parameters context and state;
errorCallback: this method will be called back if cancelling fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) changePasscode(successCallback(context,state):, errorCallback:, param:)

Method for changing the application passcode.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if change passcode succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: an object which must contain 2 key-value pairs: - oldPasscode : - passcode :

(static) changePassword(successCallback(context,state):, errorCallback:, param:)

Method for changing the backend password that is stored on the client. NOTE: this does not change the server's password.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if change password succeeds with parameters context and state;
errorCallback: this method will be called back if change password fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: object containing the password for key "newPassword"

(static) checkServerPasscodePolicyUpdate(successCallback():, errorCallback:)

Method for checking to see if the password policy has changed.
Parameters:
Name Type Description
successCallback(): this method will be called back if set succeeds;
errorCallback: this method will be called back if set fails with parameter error

(static) createSecureStore(successCallback(context,state):, errorCallback:, param:)

Method for creating the secure store.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if persisting succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: an object which must contain the field "passcode" for the store to be created. Optional field "policyContext" containing the passcode policy parameters described in method getContext.

(static) deactivateCurrentUser(successCallback(context,state):, errorCallback:)

Method for deactivate the current user in multiuser mode.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if unlocking succeeds;
errorCallback: this method will be called back if unlocking fails with parameter error

(static) deleteRegistration(successCallback(context,state):, errorCallback:)

Method for deleting the registration. It will reset the client and remove the user from the SUP server.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if deletion succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) deleteStoredCertificate(successCallbackopt, errorCallbackopt, providerID:)

delete the stored certificate
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
providerID: the provider id for the certificate provider
Example
deleteStoredCertificate(
        function(config) {alert("config: " + config);},
        function(errMsg) {alert("Error: " + errMsg);},
                          "afaria");

(static) getCertificateFromProvider(successCallback(context,state):, errorCallback:, closeScreenOnReturn:)

Method for getting certificate from third party provider
Parameters:
Name Type Description
successCallback(context,state): this method will be called back with parameters context and state if getting certificate succeeds
errorCallback: this method will be called back if getting certificate fails with parameter error Possible error codes for error domains: (TODO: update comment) Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
closeScreenOnReturn: the flag to indicate whether to close the UI screen after getting the result, the default value is false.

(static) getContext(successCallback:, errorCallback:)

Method for reading the context of logonCore.
Parameters:
Name Type Description
successCallback: this method will be called back if read succeeds with parameter context and state
errorCallback: this method will be called back if initialization fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin -2 (plugin not initialized) Context structure contains the following fields: "registrationContext": { "serverHost": Host of the server. "domain": Domain for server. Can be used in case of SMP communication. "resourcePath": Resource path on the server. The path is used mainly for path based reverse proxy but can contains custom relay server path as well. "https": Marks whether the server should be accessed in a secure way. "serverPort": Port of the server. "user": Username in the backend. "password": Password for the backend user. "farmId": FarmId of the server. Can be nil. Used in case of Relay server or SitMinder. "communicatorId": Id of the communicator manager which will be used for performing the logon. Possible values: IMO / GATEWAY / REST "securityConfig": Security configuration. If nil the default configuration will be used. "mobileUser": Mobile User. Used in case of IMO manual user creation. "activationCode": Activation Code. Used in case of IMO manual user creation. "gatewayClient": The key string which identifies the client on the gateway. Used in Gateway only registration mode. The value will be used as adding the parameter: sap-client= "gatewayPingPath": The custom path of the ping url on the gateway. Used in case of Gateway only registration mode. "registrationServiceVersion": The version of the registration service used for SMP/HANA registration. DEPRECATED! "serviceVersionForRegistration": The version of the registration service used for SMP/HANA registration. Possible values: v1, v2, v3, v4, latest } "applicationEndpointURL": Contains the application endpoint url after a successful registration. "applicationConnectionId": Id get after a successful SUP REST registration. Needed to be set in the download request header with key X-SUP-APPCID "afariaRegistration": manual / automatic / certificate "policyContext": Contains the password policy for the secure store { "alwaysOn": "alwaysOff": "defaultOn": "hasDigits": "hasLowerCaseLetters": "hasSpecialLetters": "hasUpperCaseLetters": "defaultAllowed": "expirationDays": "lockTimeout": "minLength": "minUniqueChars": "retryLimit": "allowFingerprint": } "registrationReadOnly": specifies whether context values are coming from clientHub / afaria "policyReadOnly": specifies whether passcode policy is coming from afaria "credentialsByClientHub": specifies whether credentials are coming from clientHub

(static) getMDMConfiguration(successCallbackopt, errorCallbackopt)

Get MDM configuration. Currently only supported by ios
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
Example
getMDMConfiguration(
        function(config) {alert("config: " + config);},
        function(errMsg) {alert("Error: " + errMsg);} );

(static) getMultiUserInfo(successCallbackopt, errorCallbackopt)

Get user informaiton in multiuser mode
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
Example
getMultiUserInfo(
        function(userInfo) {alert("name: " + name);},
        function(errMsg) {alert("Error: " + errMsg);}
);

(static) getNativeAppName(successCallbackopt, errorCallbackopt)

Get the native app name displayed by operating system
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
Example
getNativeAppName(
        function(name) {alert("name: " + name);},
        function(errMsg) {alert("Error: " + errMsg);}
);

(static) getPasswordPolicyForUser(successCallbackopt, errorCallbackopt, userid,)

Get password policy Calls successCallback if password policy is retrieved Calls errorCallback otherwise
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
userid, set to null in single user mode

(static) getSecureStoreObject(successCallback(object):, errorCallback:, key:)

Method for getting object from the store.
Parameters:
Name Type Description
successCallback(object): this method will be called back if get succeeds;
errorCallback: this method will be called back if get fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
key: the key for the object

(static) getState(successCallback:, errorCallback:)

Method for reading the state of logonCore.
Parameters:
Name Type Description
successCallback: this method will be called back if read succeeds with parameter state state consists of the following fields: "applicationId": "status": new / registered / fullRegistered "secureStoreOpen": "defaultPasscodeUsed": "stateClientHub": notAvailable / skipped / availableNoSSOPin / availableInvalidSSOPin / availableValidSSOPin / error "stateAfaria": initializationNotStarted / initializationInProgress / initializationFailed / initializationSuccessful / credentialNeeded "isAfariaCredentialsProvided":
errorCallback: this method will be called back if initialization fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) hasSecureStore()

Method determining whether the app is registered before calling initLogon. This method is necessary because setUserCreationPolicy must be called before initLogon, so we need some information available before initLogon is called.

(static) initLogon(successCallback:, errorCallback:, applicationId:)

Method for initializing the logonCore component.
Parameters:
Name Type Description
successCallback: this method will be called back if initialization succeeds with parameter logoncontext;
errorCallback: this method will be called back if initialization fails with parameter error Error structure: "errorCode": "errorMessage": "errorDomain": Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 1 (init failed)
applicationId: the application to be registered

(static) isFingerprintAvailable(successCallbackopt, errorCallbackopt)

Checks if fingerprint scanning is available Calls successCallback if device has fingerprint hardware and fingerprints are registered Calls errorCallback otherwise
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>

(static) isInitialized()

Method for determining whether Logon has been initialized. This method will return true if initLogon has been called, and deleteRegistration has not been called since. This method will return false otherwise.

(static) isRegistered()

Method determining whether the app is registered before calling initLogon. This method is necessary because setUserCreationPolicy must be called before initLogon, so we need some information available before initLogon is called.

(static) loadStartPage(successCallbackopt, errorCallbackopt)

load cordova start page
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
Example
sap.logon.Core.loadStartPage(
        function(successMsg) {alert("Succeess: " + successMsg);},
        function(errMsg) {alert("Error: " + errMsg);} );

(static) loadURLRequest(successCallbackopt, errorCallbackopt, url,, headers,)

Load the specified URL in webview, this method allows caller to set request headers Calls successCallback, optional, can be set to null Calls errorCallback, optional, can be set to null
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
url, string of the url to be loaded in webview
headers, the javascript object contains request headers

(static) lockSecureStore(successCallback(bool):, errorCallback:)

Method for locking the secure store.
Parameters:
Name Type Description
successCallback(bool): this method will be called back if locking succeeds;
errorCallback: this method will be called back if change password fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) persistRegistration(successCallback(context,state):, errorCallback:, param:)

Method for persisting the registration. Persisting will create the secure store and store the context.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if persisting succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: an object which must contain the field "passcode" for the store to be created. Optional field "policyContext" containing the passcode policy parameters described in method getContext.

(static) provisionCertificate(successCallbackopt, errorCallbackopt, providerID:, bRefresh:, options:)

provision certificate, the method just provision the certificate to device, it does not set the certificate provide to logon plugin
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
providerID: the provider id for the certificate provider
bRefresh: if true, check and delete the existing certificate first
options: dictionary contains the configuration for the certificate provider
Example
provisionCertificate(
        function() {alert("success");},
        function(errMsg) {alert("Error: " + errMsg);},
                          "afaria", false, null);

(static) removeAllDeviceUsers(successCallback(context,state):, errorCallback:)

Method for deleting the all registrations in multiuser mode. It will delete all user registration.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if deletion succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) removeDeviceUser(successCallback(context,state):, errorCallback:, user)

Method for deleting the registration in multiuser mode. It will delete user data vault, and also remove the user registration from the SUP server.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if deletion succeeds with parameters context and state;
errorCallback: this method will be called back if persisting fails with parameter error
user Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)

(static) reset(successCallbackopt, errorCallbackopt, preferenceToKeep)

Reset the application. The callback method may not be called if the reset results in loading the cordova start page
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>
preferenceToKeep : the preference list to keep after reset
Example
reset(
        function(successMsg) {alert("Succeess: " + successMsg);},
        function(errMsg) {alert("Error: " + errMsg);} );

(static) scanFingerprint(successCallbackopt, errorCallbackopt)

Opens dialog window to prompt user to scan their fingerprint Calls successCallback if scan is successful Calls errorCallback if user closes dialog
Parameters:
Name Type Attributes Description
successCallback function <optional>
errorCallback function <optional>

(static) setAfariaCredential(successCallback(context,state):, errorCallback:, context:)

Method for setting afaria credentials for retrieving seed data/afaria certificate
Parameters:
Name Type Description
successCallback(context,state): this method will be called back with parameters context and state if afaria credential is valid;
errorCallback: this method will be called back if registration fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
context: the context which must contain properties with following parameters: - afariaUser - afariaPassword

(static) setParametersForProvider(successCallback(context,state):, errorCallback:, context:)

Method for setting parameter for certificate provider
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if parameters are set properly;
errorCallback: this method will be called back if setting parameters fails Possible error codes for error domains: (TODO update comment) Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
context: the context which must contain properties with following parameters: - afariaUser - afariaPassword

(static) setSecureStoreObject(successCallback(bool):, errorCallback:, key:, object:)

Method for setting object to the store.
Parameters:
Name Type Description
successCallback(bool): this method will be called back if set succeeds;
errorCallback: this method will be called back if set fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
key: the key for the object to be stored
object: the object to be stored

(static) setSSOPasscode(successCallback(context,state):, errorCallback:, param:)

Method for setting clientHub sso passcode.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if setting succeeds;
errorCallback: this method will be called back if update fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized)
param: object containing the ssopasscode for key "ssoPasscode"

(static) setUserCreationPolicy()

Method for setting the UserCreationPolicy on the Logon Core. This method is intended to be used to force registration with a client certificate. This method must be called before initLogon to have any effect.

(static) skipClientHub()

Method for skipping registration through client hub.

(static) startProxy(successCallback():, errorCallback:, proxyID:, proxyURL:, proxyExceptionList:)

Method for start per app secure proxy
Parameters:
Name Type Description
successCallback(): success callback;
errorCallback: this method will be called back if failed
proxyID: the proxy cordova plugin id
proxyURL: the proxy url to initialize the proxy library
proxyExceptionList: the regex list for requests that should be handled by proxy library, application should ignore those requests

(static) startRegistration(successCallback(context,state):, errorCallback:, context:)

Method for registering user.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if registration succeeds with parameters context and state;
errorCallback: this method will be called back if registration fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
context: the context which includes registration parameters as described in getContext method.

(static) unlockSecureStore(successCallback(context,state):, errorCallback:, param:)

Method for unlocking the secure store.
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if unlocking succeeds;
errorCallback: this method will be called back if unlocking fails with parameter error Possible error codes for error domains: Error domain: MAFLogonCoreCDVPlugin - 2 (plugin not initialized) - 3 (no input provided)
param: object containing the passcode for key "unlockPasscode"

(static) useAfaria(successCallback(context,state):, errorCallback:)

Method for disable or enable afaria
Parameters:
Name Type Description
successCallback(context,state): this method will be called back if succeeded;
errorCallback: this method will be called back if failed