Overview
The GovX verification pop-up script is used if you want the verification app to launch in a pop-up on your site. The script allows GovX to control the content of the pop-up, size of the pop-up and redirect in the original browser window.
Requirements: To use the GovX verification pop-up script, you must meet the following requirements:
- Your website or application must use the jQuery library, unless you write your own custom event handlers for the pop-up (details below)
- You are deploying GovX verification via Ticket Links. If you are deploying verification via OAuth, you will need to control the experience.
Implementation
Place script tag
You must place the GovX verification pop-up script tag on the page where you've embedded the verification links. It should be placed after the jQuery tag on your page, however, it does not matter if this is in the document head or body.
<script src="https://auth.govx.com/public/govx-popup-registration.js"></script>
Add GovX event handler
Copy and paste the code below immediately following the GovX verification pop-up script tag. This code is our stock event handler, specifically for the GovX pop-up click. Alternatively, you can write your own code to handle the click event, but we recommend using ours unless you have a specific reason to modify it (like adding tracking, etc).
<script>
$(document).on('click', '.govx-popup-registration-link', function(e) {
e && e.preventDefault();
window.govx.showGovXTickets(this.href);
});
</script>
If you are using our event handler, your website or application must use the jQuery library. If your site does not use jQuery, you will have to write your own custom event handler in order for the GovX verification pop-up script to work.
Append class to links
If you are using the GovX event handler, you will need to append the class "govx-popup-registration-link" to any of the verification links you want to open in a pop-up. For example:
<a class="govx-popup-registration-link" href="https://auth.govx.com/tickets/verify/{clientId}/{xref}?display=popup&goTo=login">Login</a>
That's it! When a user clicks the verification link on your site, GovX will serve the verification app in a pop-up. At the end of the flow, we will redirect back to the original browser window.
Comments
0 comments
Please sign in to leave a comment.