Integrate Asignio into your Web Application
Integrating Asignio into your web application is a simple process consisting of 3 steps:
- Contact us to request an Application Token for your web application and the URL for the Asignio Web Plug-in
- Implement server code back-end verification with Asignio servers
Detailed instructions are below.
Request Application Token and Plug-in URL
Each application that utilizes Asignio is issued an Application Token to securely identify the application. This token is used in all secure communications between the web application and the Asignio servers.
As part of the application set up process, Asignio associates the action to be taken once authentication is complete. Developers tell Asignio which URL to call when Asignio authenticates a user. This call back tells the web application that the user has been authenticated.
Below is an example of plug-in initialization:
applicationToken: "[Application Token]",
containerID: "[ID of div that contains the plug-in on the page]"
applicationToken: Without an active, authorized application token, any communication to the Asignio servers will be rejected.
containerID (optional): The Asignio plug-in renders some HTML elements into the DOM, including a sign in button that changes function based on the user's device (e.g., laptop/desktop vs. mobile). Developers can determine the location of the sign in controls by providing its container ID.
Once the AsignioAuth object is initialized (as shown above), the plug-in adds an Asignio sign in button to the DOM inside the indicated container. Users can sign in to a website on the laptop/desktop using the QR Code that appears when the Asignio sign in button is clicked. Users can sign in to the website from their mobile browser by tapping on the Asignio sign in button, which launches the Asignio application on their mobile device.
Once an authentication session begins, the Asignio plug-in listens for the Asignio server's response indicating that the user has been authenticated, and executes the call back indicated by the developers.
Add server code for Back-end Verification
Once the plug-in receives the response from the Asignio server confirming user authentication, it executes the call back URL that has been configured for this application. Developers need to add a server call to the Asignio servers to finalize authentication. This call is executed as part of the call back URL.
The server call to the Asignio retrieves the user token associated with the user on the developer's web application. This token is what connects the Asignio user to the developer's site user.
Developers need to add a single call via an HTTP request, and then handle the reponse that comes back from the Asignio server. The details of this call are provided to developers when they also receive their application token.