Authentication Flow Web Demos

To see how ZenKey works on Node, Java, PHP, or Python, follow the demos in this section to observe the authentication flow from start to finish. Learn how to request available scopes and complete a request to send money after logging in to the demo app.

1: Sign in with ZenKey

Authentication flows for the Node, Java, PHP, and Python apps are nearly identical. Visit any of the following demo pages to see how your app should function:

Press the “Sign in with ZenKey” button to log in.

2: Discovery UI

The ZenKey button loads the Discovery UI web page. Until the user trusts the browser, they will be asked to open the ZenKey app and navigate to “Trusted”, then either capture a code with their camera or enter a numeric code.

3: Login Request Sent

Once the user trusts the browser, the Discovery UI page displays the last four digits of the phone number associated with that ZenKey account. The user has the additional option to “Trust a Different ZenKey Account”. Selecting the trusted account sends a login request to the device configured with that phone number.

4: Push Notification Received

From the web browser, the user receives instructions to check their phone to confirm the login request.

The device used in Step 3 receives a push notification asking whether the user would like to confirm the transaction.

5: Consent Screen

The Consent screen appears. The user sees which scopes the mobile carrier shares and may either “Agree” to share the relevant attributes or “Deny” the request.

6: Authentication Redirect

Selecting “Agree” from the consent screen returns the message “You have successfully authenticated. Redirecting...” and log the user into the demo web app. The demo app returns the JSON response including all the user information requested by your scopes and approved by the user. The sub is an identifier that pairs a single user with a particular client_id. After receiving the sub, this unique ID is stored in your user database for reference. Do not transmit this sub to your client app.

{   “sub”:”mccmnc-1234567abcdefghijk”,
    “name”: {
        “value”:”Jane Doe”,
        “given_name”: “Jane”,
        “family_name”: “Doe”},
    “email”:{
        “value: “[email protected]”},
    “postal_code”: {
        “value”:“90210”},
    “phone”: {
        “value”:“+13101234567”},  
}

7: Send Money

After logging in, the web app provides the option to send money. Choose an amount to send (this has no actual functionality, it simply shows the flow) and specify a recipient. Clicking the “Continue with ZenKey” button initiates the authentication process again, sending a login request via a push notification that asks the user to confirm the transaction.

8: Confirm Transaction

Upon receipt of the push notification, the ZenKey app on the device prompts the user to confirm sharing the amount specified as well as the name of the recipient.

9: Success Screen

Selecting “Confirm” loads a success screen on the web app whose message specifies the amount of money sent to the recipient (e.g., “Success: $25.00 was sent to John Doe”).


Did this page help you?