CA Mobile Authenticator SDKs for Android

The following Android SDKs can help you create your own app for receiving push notification for secondary authentication.
aa821test
The following Android SDKs can help you create your own app for receiving push notification for secondary authentication.
getAccount
Description
This method finds the account information for the given key
API Signature
Account getAccount(final String id) 
key
Specifies a unique key to identify the record, it's obtained from Account class. 
 
Return Values
acc
Returns CA Mobile Authenticator Account object. 
saveAccount
Description
This method saves the account onto device storage.  
API Signature
- (void) saveAccount(
final
 Account 
acc
Input Parameters Account  
Specifies a CA Mobile Authenticator Account
getAllAccounts
Description
This method returns all accounts found on the device's storage system.
API Signature
Account[] getAllAccounts()
Return Values
account  arry
Returns an array of CA Mobile Authenticator Account objects.
deleteAccount 
Description
 
This method deletes the account from the device. 
 
API Signature
 
- void deletePushAuthAccount(Account acc)  
 
Input Parameters Acc
Deletes CA Mobile Authenticator Account object.
authenticateUser
Description
This method is used to authenticate the user when push notification is received on the device. This method sends the user authentication request to the server when push notification is received on the registered device. To receive push notification and sending user authentication request, user must register device first by calling registerDevice() API.
Application Signature
void authenticateUser(String authData, String userResponse) 
Input Parameters
authData
Specifies the authentication data received in push notification data body which CA Mobile Authenticator SDK can consume to send the authentication request to server
authResponse
Indicates enum value for user response. APPROVE value for approving authentication and DENY for denying a transaction
Return ValuesAuthStatusCode 
Returns the status code returned by the API.
Example:
notificationAuthData = "\"data\" : {
 \"userId\" : \"User Identifier\",
 \"OrgId\" : \"AA Org for which authentication request is initiated\",
 \"hostName\" : \"Host to which authentication request will be forwarded\",
 \"txnId\" : \"transaction Id generated by AFM for authentication purpose\",
 \"authUrl\" : \"authentication url where SDK needs to send authentication request\",
 \"serverData\" : \"Encrypted data which contains - Server OTP\",
 \"authInterval\" : time_in_seconds
 }"
AuthenticatorDelegate
Description
This method must be  used to initialize the class with AuthenticatorDelegate delegate instance. In this case, CA Mobile Authenticator SDK uses built-in sqllite database storage.
API Signature
- String getDeviceToken(); 
Input Parameters 
authDelegate
Defines the instance of AuthenticatorDelegate. 
 CA Mobile Authenticator makes calls to delegate APIs to get the device token from mobile application while registering device and fetching accounts from DB. This device token needs to be uploaded to server for sending push notification to user device. 
Return Values
id
Indicates the initialized object.
getDeviceToken
Description
This delegate method is called back in CA Mobile Authenticator SDK to fetch the device token from push notification servcie provider used by the mobile application. The CA Mobile Authenticator SDK makes use of the token returned from this delegate method for performing registration/updation/deletion of the user device from CA Adv Auth Server.
 
This method should always return latest device token.
API Signature
-  String getDeviceToken; 
Return Values
Account*
Returns the AC Authenticator Account object.
registerDevice
Description
This method can be used to register a device(on which application is installed) for the given user. This method will send the device registration request to server which will associate the requesting device to use. Before creating user-device association, server will authenticate the user by verifying OTP value sent to server and then register the device for given user.
API Signature
void registerDevice(String userId, String provisioningUrl, String activationCode, Hashtable props) 
Input Parameters 
userId
Specifies user identifier for which device needs to be registered.
provisioningUrl
Specifies the URL used for connecting to the provisoning server using http method.
activationCode
Specifies the activationCode is provisioning authorization/activation code.
props
Specifies the props is a dictionary of properties to be used for sending additional device information to server.
Return Value
Account* 
Returns the AC Authenticator Account object.
Remarks
Any special case for APIs input parameter or return values or special.
 
getVersion 
Description
 
This method returns the version of the library.
API Signature
 
String getVersion() 
Errors and Exceptions
For more information on Errors and Exceptions, see the following list:
aa821test
E_REGISTERDEVICE_FAILED 27 Device registration failed. E_NETWORK 20 Unexpected network error. E_TIMEOUT 21 Connection timed out. E_USER_TRANSACTION_DENIED 26 Authentication denied. E_AUTH_EXPIRED 28 Authentication request timed out. E_AUTH_ALREADY_PROCESSED 29 This authentication request is already processed. E_REGISTERDEVICE_ALREADY_PROCESSED 30 This device registration request is already processed. E_SERVER_MSG 22 An Internal Error has occurred. DEFAULT Any other error codes An Internal Error has occurred.