Appendix-A: Activities to be done on Application
- 25 Apr 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Appendix-A: Activities to be done on Application
- Updated on 25 Apr 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Below are activities to be done on the application to use the User Authentication API:
- Call Cross Identity Authentication API with required inputs in its authentication module.
- Process the response from CID and create a session for that user if CID provides a successful authentication response and allows the user to access the application.
- Show the proper message to the user if CID provides an unsuccessful authentication response
Detailed Steps:
The application invokes the below authentication API to delegate the authentication to Cross Identity to achieve authentication on the mobile application (APK-based application).
Follow the steps below to allow APK-based applications to authenticate through Cross Identity.
- The application uses the Cross Identity Authentication API as given below. URL: http://<UAT_Cross Identity URL>/api/v1/userAuthn. Example - https://ci-demo.crossidentity.com/CIDSaas/api/v1/authuser
- Below is the sample code snippet for calling the authentication API using JavaScript.
var user = {};
user.username="test.user01";//CID
username user.cred="Password";//CID password
user.domain = "addomain.com";//Active Directory Domain name, if needed
var userstr = JSON.stringify(user);
$.ajax({ url:
“https://ci-demo.crossidentity.com/crossidentity/api/v1/userAuthn", type: "POST", data:{user:userstr}, success: function(response){ alert("success");
var presp = JSON.parse(response); alert(presp.auth);
},
error:function(response){ alert("error"); }
});
Was this article helpful?