How to Build the Schlage Employee Badge Mobile Credential Android App

How to Build the Schlage Employee Badge Mobile Credential Google Wallet App

Last modified: 08.16.2024

 

The purpose of this guide is to walk a software development team through the steps necessary to build the Schlage Employee Badge Mobile Credential Google Wallet App. The Schlage Employee Badge Android Quick Start App, along with the Allegion Mobile Access Android SDK, allows organizations to understand how to build their own app that delivers NFC-based Schlage Credentials to the Google Wallet for use as a replacement or alongside physical card-based credentials. This guide covers the steps for building a Quick Start app. With the information covered in this guide, a software team is prepared to implement their own production ready version of the app.

If you're already familiar with the high-level details of an Employee Badge project and are looking for implementation specifics you can jump to the Building the Employee Badge Quick Start App for Google Wallet section of this guide.

 

ℹ️ What about the Schlage Mobile Credentials iOS App?
If you're looking for how to implement Schlage Employee Badge Mobile Credentials for iOS, click here.

 

The Employee Badge Mobile Credentials App is a fairly simple to use, and the application code is not very complex, however; the process to build the app involves a significant amount of up-front setup and configuration work. This guide seeks to walk through all requirements, dependencies and setup steps to complete the process in a straight-forward and easy-to-consume manner. Where necessary, references to other relevant guides will be linked to ensure no gaps exist to completing integration.

This guide does not assume the reader has advance knowledge of Wallet-based app development. The reader may choose to skip ahead as necessary where topics are already known or dependencies are already in place. Dependencies are listed in the Dependencies section of this guide.

Target Audience for this Guide

This guide is intended to be read and used by anyone who is responsible for technical implementation of a Schlage Employee Badge Mobile Credential project, including mobile app developers, backend developers and project managers. It will also be useful for technical resources responsible for provisioning credential management systems and technical administrators responsible for managing credentials.

Glossary of Terms

Since not everyone who reads this guide will be familiar with language used in physical security and access management, this section covers definitions for terms commonly used in the space.

Term Definition
Access Control System (ACS)  An Access Control System is a software platform that manages access rights of physical spaces and resources based on predefined rules, policies and user access rights. ACSs provide a unified platform for managing access to spaces and resources across an enterprise and capture real-time information related to who is attempting to use/access spaces and resources at all times. Access control systems work alongside access control devices such as locks, credential readers and modules to control physical space access and govern assignment of credentials to support access control management policies.
Bluetooth Low Energy (BLE) BLE is a short-range wireless networking protocol based on Bluetooth, designed especially for short-range communication and used extensively in security, IoT and other applications where device-to-device communication is a requirement. BLE is useful where device battery life is prioritized over high data transfer requirements. Most smart phones available today are BLE-compatible. BLE (beacons) has an indoor broadcast signal range of 10-30 meters.
Credential  In access control, a credential is a piece of data, document or physical object owned by or granted to an individual by a third party that establishes the individual's identity and authority within a given physical and digital environment. Examples of credentials are plastic employee badges, pin codes, physical door keys, or a person's fingerprint or retina. 
Near-Field Communication (NFC)  NFC is a very close proximity wireless communication standard, NFC based on the Radio Frequency Identification (RFID) standard, designed especially for near-physical communication and used extensively in security, IoT and other applications where device-to-device communication is a requirement. Most smart phones available today are NFC-compatible. NFC (tags) has a broadcast range of 4 centimeters. 
Patron  In access control, a patron is a bearer and user of a credential. 
Reader (or Module)  A reader is a device that controls access to a given space or resource. Readers communicate with and 'read' credentials presented to them and work alongside an Access Control System to determine if a patron has authorization to the resource or space it controls. Readers communicate access requests to an access control system, including unauthorized access requests, tamper attempts and breaches. 

Overview of an Employee Badge Mobile Credentials Project

This section covers the high-level process overview of the Employee Badge implementation project and description of each phase of the project.

Discovery, Requirements Analysis & Gap Analysis

 

High Level Employee Badge Project Overview


  1. The company will sign required Google NDA and Service Agreements to begin receiving access to proprietary documentation and processes as part of initial discovery.

  2. Allegion and the company will conduct a site survey and discovery meetings to determine all requirements, relevant systems and dependencies for implementing a mobile access project. This will include evaluating existing hardware to determine all firmware requirements and configuration updates. This may also include onsite hardware testing and demonstration of readiness.

  3. A company's developers will be granted access to the Schlage Mobile Access NFC SDK and Allegion Mobile Access APIs and the Schlage NFC Quick Start app for Google Wallet. The quick start app will be particularly useful in understanding the structure of an app.

  4. After requirements have been collected, Allegion and company will work together to confirm project goals and determine solutions for any identified gaps.

Scoping & Project Planning

Your Allegion representative(s) will work with you to determine project scope and requirements

Implementation & Testing

  1. Project work begins including development work against Schlage APIs and SDKs:

    1. The company will work with Allegion to request access to Google Wallet-specific developer entitlements for Google mobile development. These entitlements are granted by Google only during implementation of a Google wallet-based project.

    2. Development work will commence to connect the Allegion Cloud with the company's access control system. This work allows the company to send new patron records to Allegion and receive back a record of a new credential for that patron.

  2. Company hardware (locks, readers) will be configured and prepared for use with Google Wallet-based mobile credentials

  3. Patron training materials will be developed from template content including how-to guides, FAQs and other supporting documentation

  4. Testing - including end-to-end testing and user acceptance testing - will be completed. Testing will also require review, validation and certification of test cases by Allegion.

Launch & Ongoing Support

  1. Existing credential support staff will be trained on the use of the new wallet-based mobile credential technology and prepared for inbound patron technical support requests.

  2. Production support plan will be implemented based on previously defined and agreed support requirements.

  3. A pilot will be conducted to with a subset of patrons to validate the solution is working and address any outstanding issues with the solution.

  4. The full launch will commence.

Who is involved in an Employee Badge Project?

Implementing an Employee Badge project involves work and coordination across the following organizations and resources:

  • Allegion - provides software and hardware to support implementation. Allegion will also assign a Project Manager and Technical Account Manager to every Mobile Credentials project.

  • Integrator - The integrator is typically responsible for access control hardware installations, management and firmware updates. Employee Badge projects will always include the integrator as they will have critical information and important responsibilities necessary to prepare and configure hardware to support the project.

  • Mobile App Developers - If an app is being built to support this project, mobile app developers will be engaged to complete development. The mobile app is used to authorize the patron, associate the patron with a credential and store newly provisioned credentials into the Google Wallet.

  • Cloud Developers - An engineer will need to implement an integration between an existing Access Control System and the Allegion Cloud. This integration is required to provision new credentials.

  • Cloud System Engineers - An engineer or technical resource will need to configure single sign-on with the corporate identity service used to manage patron identity. This resource will also support ensuring all systems are able to communicate with each other and supporting activities such as system configurations, whitelisting of IP addresses, etc.

  • Project Manager - A project manager will manage this project and will manage not only the implementation but also support testing, documentation development, support process development, employee/patron training and system launch.

Requirements & Dependencies for an Employee Badge Project

This section covers the required and/or supported hardware, software as well as developer tools and development experience required to implement an Employee Badge app for Google Wallet.

Minimum Developer Experience Requirements

Because this is a technical solution and requires development to implement, the development topics in this guide cover topics at a level that expect developers to have knowledge of Android development processes, tools and technology, including experience with the Android Studio IDE and use of Gradle Build Manager. It also assumes developers have had previous experience developing and distributing Android mobile applications to the Google Play store.

Enterprise Software Requirements

Schlage Employee Badge solutions are deployed within and supported by a corporate information technology environment and infrastructure. There are some technologies that need to exist in that corporate environment to support this solution:

  • Physical Access Control System (PACS) - The organization must manage their locks and readers using a PACS. Allegion can support all major PACS for Employee Badge. Your Allegion Customer Success engineer can provide full details on PACS requirements, the scope of which is not covered in this guide.

  • Identity Management System (IdM) and Single Sign-On (SSO) - The organization must have an IdM deployed that validates employee identity and authenticates/authorizes employee access to corporate applications and systems. SSO must be supported for user authentication.

     

Mobile Hardware & Software Dependencies

 

Compatible Hardware

  • Any Android device that has NFC Hardware, can download the Google Wallet app and is running Android 12 or later

Note: Google Wallet Partner Terms and Conditions must be accepted

 

Lock & Reader Hardware Dependencies

 

Lock Hardware Dependencies

The table below lists all Schlage locks that support the Mobile Credentials solution:

Locks that support Android NFC Hardware Version Info Firmware Version for Initial Android NFC Certification Certification Status
Schlage Control B Locks All hardware versions support Android NFC 04.12.00 Complete
Schlage Control BM Locks All hardware versions support Android NFC 05.11.39 Complete
Schlage NDEB Locks All hardware versions support Android NFC 03.07.01 Complete
Schlage LEB Locks All hardware versions support Android NFC 03.07.01 Complete
Schlage NDEB Si Locks All hardware versions support Android NFC 03.09.07 Complete
Schlage LEB Si Locks All hardware versions support Android NFC 03.09.07 Complete
Schlage AD300 Must have MT2/MTK2 Reader AD.A.125 Complete
Schlage AD400 Must have MT2/MTK2 Reader AD AD.A.125 Complete

Readers & Modules Hardware Dependencies

The table below lists all Schlage readers & modules that support the Mobile Credentials solution:

Readers that support Android NFC Hardware Version Info Firmware Version for Initial Android NFC Certification Certification Status
Schlage RC Reader Controller
(RC11, RC15, RCK15)
All hardware versions support Android NFC 01.08.02 In process
Schlage MTB Readers
(MTB11, MTB15, MTBK15)
All hardware versions support Android NFC 60.47.14,
60.47.27
In process
Schlage MT15, MTK15, MT11, MTMS15, MTMSK15 Readers All hardware versions support Android NFC 22.02 Complete
Schlage OEM200 Modules All hardware versions support Android NFC 2.01 Complete
Schlage MT20 Enrollment Readers All hardware versions support Android NFC 9.02 Complete

 

Employee Badge High-Level Architecture

Employee Badge High-Level Architecture

Schlage Mobile Credentials give patrons the ability to use an NFC-based credential - known as a pass - stored in their phone's Google Wallet - to gain access to secured spaces managed by an Access Control System (ACS).

Schlage Employee Badge Mobile Credentials for Google Wallet are implemented using two technologies from Schlage:

  • The Schlage Mobile Access NFC SDK for Android - hosted in a Github repository, this SDK brokers interactions between the Allegion Cloud, the patron's Google Wallet and the PACS Single Sign-On and Corporate Identity Service. Its purpose is to support securely getting Employee Badge mobile credential pass into the Google Wallet. The Schlage NFC Quick Start App for Android uses the Mobile Access SDK to demonstrate for engineers how to build an app.

 

ℹ️ Why is a mobile app even required to get an NFC Credential into the Google Wallet?
As of May 2023, the only means that Android provides to deliver NFC credentials into the Google Wallet relies on Android SDKs. In the future this may change, but for now, an app is required to provision the credential and deliver it to a patron's wallet. This means if you are building a new app for the purpose of delivering credentials (as opposed to modifying an existing app that already does other things in your organization), the app is simple and won't do anything beyond provisioning credentials.

 

  • The Schlage Employee Badge Product API - hosted in the Schlage Cloud, this API exposes the following capabilities:

    • Creation of a patron record and user access rights in the Allegion Cloud (also known as ingress)

    • Gives the PACS partner the ability to suspend, resume and delete user credentials (and propagates these changes with Google)

    • Gives the PACS partner the ability to update information on the pass including name, photo, email address and other patron information.

Other components needed for implementation include:

  • A Physical Access Control System (PACS - may be provided by Allegion)

  • An Identity Management Platform/Service

  • A Single Sign-On solution

  • An endpoint established to capture inbound data responses from the Schlage Cloud

  • Compatible hardware (locks and readers)

 

ℹ️ An important consideration as you build your app is the method of distribution. Will the app be publicly available in the Play Store or available only by a direct link using unlisted app distribution? The distribution method chosen will be an important part of testing and documentation development as you complete your app.

 

The remainder of this document will focus on implementation development activities and is intended for a technical audience (Developers, System Administrators).

 

Building the Employee Badge Quick Start App for Android

The steps in this topic will focus on preparing your environment and then building the Employee Badge Quick Start app for Android. This guide assumes the developers working to build the app meet the following minimum dependencies for completing such a task:

  1. Developers have access to the latest version of the Android Studio IDE.

  2. Developers have experience building Android mobile apps.

  3. Developers have experience using the Gradle build manager to manage code.

 

Step 1 - Create an Allegion Developer Account and Request a Mobile SDK Subscription Key

If you have not already done so, you'll need to create an account in the Allegion Developer Portal in order to gain access to the API and SDK documentation for the Allegion Employee Badge product. You'll also need this account to obtain a Mobile SDK Subscription Key, which is required to initialize and use the SDK within your app.

 

⚠️ Important: The Mobile SDK Subscription Key is different from the API Subscription Key

As you build an Employee Badge solution, your team will be working with APIs and SDKs across two different projects. Each project outlines specific areas of development effort and uses a different subscription key to interact with Allegion. For this guide/project, we'll be focused on mobile app development and so we'll be using the Mobile SDK Subscription Key to interact with Allegion SDKs.

When building the integration between an Access Control System and Allegion Cloud (the subject of a different guide), an API Subscription Key is used. These are each different keys with different permissions, and are not interchangeable. Mixing/matching keys will result in errors and frustration, so we'll make this callout in several places throughout this and other guides.

 

Follow these steps to create your account and request your Mobile SDK Subscription Key:

 

  1. Click here to reach the Allegion Developer Portal

     

    Allegion Developer Portal Login Page

  2. Click the Sign In link in the top right corner of the landing page.

  3. If you have an account, enter your account details and click Login to log in.

    Allegion Developer Portal Login Challenge

    If you don't have an account, click the Create Profile button to create an account. Enter required details to create an account and complete the email verification step to continue. You'll also need to complete profile details to proceed.

  4. Once you have your profile you'll be directed to your Account Profile page. This is the area where you'll see Product subscriptions to which you've been granted access. If you've never requested access to use Allegion Products then you'll see an empty list here that displays, "No results found":

    Allegion Developer User Profile Page

     

  5. To obtain a key, send an email to Allegion Customer Success requesting a "Mobile SDK Product Subscription Key (https://developersupport.allegion.com/hc/en-us/requests/new?ticket_form_id=32387239325844&tf_22658560153748=new_integration) for the Employee Badge Android Mobile App. Expect to get a response in no less than 24-48 hours.

     

  6. ℹ️ Limit One Mobile SDK Subscription Key and one API Subscription Key per Company
    Allegion will only grant one Mobile SDK Subscription Key and one API Subscription Key per Company. If multiple developers on your team have an Allegion Developer Account, you'll want to choose one of those accounts to receive the subscription. Only one key is needed for development, regardless of the number of apps you plan to build.

  7. Once a response from Allegion is received confirming your access request has been processed, navigate to the products tab, from the Allegion Developer Portal click the "Schlage Mobile Credentials" product appropriate for your environment (Allegion pilot or production), enter the desired name for your subscription key, and click subscribe.

     

  8. After you have get your Mobile SDK Subscription Key, navigate to your profile - here you will be able to view your subscription keys.

     

    Allegion Developer User Profile Page with subscriptions

     

Step 2 - Request Access to the Schlage Employee Badge Quick Start App, and NFC SDK for Android (Allegion Github Repository)


Next, we'll request access to the Schlage Employee Badge Quick Start App for Android codebase. The app uses the Allegion Mobile Access NFC SDK alongside the Allegion Employee Badge APIs to demonstrate how to get an app built and running. You'll need to request access to both Github repositories. This Quick start app will serve as a reference app to follow along to while you build your own. To make the request just reach out to your Allegion Customer Success engineer and request this access (https://developersupport.allegion.com/hc/en-us/requests/new?ticket_form_id=32387239325844&tf_22658560153748=new_integration) and provide the Github username/email address associated with the Github account to which you need access granted.

 

 

Step 3 - Download the Schlage Mobile Credential Quick Start App for Android Project

Once you have access to the Allegion Github repository, you'll need to download the Quick Start App Project and open it in android studio.

  1. Download the latest version of Android studio
  2. Clone the Android NFC Quickstart app
  3. Using the Android Studio file browser, open the parent folder for the quickstart app named NFCQuickStartAppAndroid

    root folder selected


Now we can move on to configure the environment and build the app.

 

Step 4 - General Application Flow & Configuring the App Environment

This section will set environment details and provide more detail how the app works. Before we cover steps to configure the environment, it's important to understand what the app is designed to do.

The purpose of this app is to create a digital credential for an authorized user/patron and deposit that credential into the Google Wallet. The user's identify must be verified as valid in order for the app to progress to generating a credential on their behalf. The process of verifying identity relies on a corporate Identity Management System (IdM). The app will challenge the user to supply a username and password and have the IdM confirm the user as valid. Once the user has been authorized, the app will generate a digital credential and allow the user to deposit/store it in the Google Wallet. The complete app flow is detailed below.

 

General Application Flow

This sequence diagram illustrates the flow of activities the Quick Start app follows in order to deposit a digital credential into the Google Wallet, and is an appropriate best practice design for developers to follow as they build/modify their own application to include this capability. This flow covers activities across the mobile app, the Allegion Mobile Access SDK, a generic IdP and the Google (Android) wallet.

Flow Diagram

Configuring the Environment


  1. Enable Sandbox mode for the Google Wallet
    • Create an empty and extensionless file titled android_pay_env_override_sandbox, this can be done with the command touch android_pay_env_override_sandbox
    • Move this file to the downloads directory on the device to be used with the quickstart app
    • Verify sandbox status by navigating to Google Wallet > Wallet settings and observing the message “you are in sandbox”

  2. Create Keystore :
    • In android studio, navigate to Build > Generate signed bundle or APK

      generate bundle selected

    • Select APK

      APK selected

    • Fill out the fields presented by the interface appropriately, if you have an existing key you would like to use you can enter it in the interface here, or you can generate a new one.

      generate or use key options

    • Select the applicable environment and create
    • debug selected


    ⚠️ Important: Google requires this key!
    This Key will be required by google as part of the process detailed in the next section of the guide covering the submittal of requests for supplimental code and entitlements.

  3. Refrence Keystore in build configuration
      Navigate to module level build.gradle > Android > SigningConfigs and insert the following code snippet -
      debug {
      
            storeFile file('..\\{YOUR_KEYSTORE}.jks')
                
            storePassword properties.getProperty('{YOUR_SIGNING_PASSWORD}')
                
            keyAlias 'key0'
                
            keyPassword properties.getProperty('{YOUR_SIGNING_PASSWORD}')
                
          }
                
                
    • Create the signing password property in the local.properties file for the code above to reference signingPassword={SINGING_PASSWORD}

      Auth0 Applications


  4. Refrence Github PAT token to retrieve dependencies
    • Generate a github PAT Token with Repo read access if you do not already have one, this can be done my navigating to Your Github Profile > settings > Developer Settings > Personal Access Tokens > Tokens (Classic) > Generate New Token
    • Currently, the github personal access token must be put as plaintext in the repos.gradle file as shown below.

      Auth0 Applications

 

Step 5 - Request and complete the form for Google Entitlements


In order to present the "Add to Wallet" button, as well as push a credential to the google wallet, google must grant access to those resources.

A link to the form to request access to the tap and pay client can be found here.
A link to the form the rquest access to the APIs and "Add to Wallet" button can be found here.

Once those forms are filled and submitted a google representivite will be in contact and will be able to provide access to the private documentation that covers usage of the API and tap and pay client. Using the guidance from that documentation one will need to add the Tap and Pay source code to the quickstart app and/or project.

 

 

Step 6 - Configure your IdM Callback & Logout URLs

The Quick Start App was designed to use a standard OAuth flow to process authorization requests. You'll need to configure your Identity Management System to recognize requests coming from the Quick Start app in order for the OAuth process to properly flow. To do this, you'll need to specify your Quick Start App as a valid client for performing authorization requests, which involves designating the app's callback and logout URLs.

The Quick Start app uses Auth0 for this purpose, so this guide will demonstrate where to make this change in Auth0, however any IdM will allow this setting to be applied.

  1. Log into Auth0.

  2. Browse to Applications and select the application associated with your app. If you have not created one then create a new application by clicking the Create Application button and following the prompts.


    Auth0 Applications


  3. Once in the Application details, scroll down to the Application URIs section. You'll be populating the Allowed Callback URL and Allowed Logout URL:


    Auth0 Application Config Details


  4. Populate the Allowed Callback URLs section with the following value:

    [App Bundle ID]://[IDM Domain]/ios/[App Bundle ID]/callback


    Replace both references of [App Bundle ID] with your App's Bundle Identifier and replacing [IDM Domain] with your Auth0 domain (found at the top of the Auth0 application details page). For instance, given Auth0 domain of myapp.us.auth0.com and App Bundle Identifier of com.mycompany.thisCompanyBadgeApp, you would populate the Allowed Callback URL as:


    com.mycompany.thisCompanyBadgeApp://myapp.us.auth0.com/ios/com.mycompany.thisCompanyBadgeApp/callback

    Auth0 Callback Config

  5. Populate the Allowed Logout URLs section with the following value:

    [App Bundle ID]://[Auth0 Domain]/ios/[App Bundle ID]/callback


    (Note: The Quick Start app happens to use /callback as the endpoint for both callback and logout URLs.)

     

    Replace both references of [App Bundle ID] with your App's Bundle Identifier and replacing [IDM Domain] with your Auth0 domain (found at the top of the Auth0 application details page). For instance, given Auth0 domain of myapp.us.auth0.com and App Bundle Identifier of com.mycompany.thisCompanyBadgeApp, you would populate the Allowed Callback URL as:


    com.mycompany.thisCompanyBadgeApp://myapp.us.auth0.com/ios/com.mycompany.thisCompanyBadgeApp/callback


    Auth0 Logout Config


  6. Scroll to the bottom of the page and click the Save Changes button to save the Auth0 application configuration changes.

    Auth0 Save Changes

 

Step 7 - Create an API for your Identity Management Application


Your Identity Management System will need to provide an API to Allegion so tokens generated in your mobile app can be validated for use with the Allegion Cloud service. Specifically, you'll need to create an API that represents Allegion as the target - or, Audience - for tokens representing this user. Auth0 uses the term Identifier to represent the Audience claim for an API. Your app will then specify a URL representing Allegion's Cloud Service as the Audience. This is a simple task in Auth0 but must be done before the Quick Start app will recognize token that Allegion's cloud will consider valid for processing user requests.


  1. From the Auth0 dashboard, browse to Applications --> APIs


    Auth0 APIs

  2. Click the Create API button.

     

    Auth0 APIs

  3. For the Name field, enter a name for your new API such as Allegion Employee Badge App API


  4. For the Identifier field, enter https://api.allegion.com/employeebadge/partnerqa - note that this is the required audience for an employee badge token

    Auth0 APIs

     

  5. Click the Create button to create the API. Once done, your API should be successfully created and ready to process requests from your app.


    Auth0 APIs

Step 8 - Add a custom claim to your Access Token (JWT)

Allegion relies on a custom claim sent within your access token (JWT) to capture the email address of the user attempting to add a mobile credential, aswell as another custom claim to identify the integration ID. The email address is an important piece of information because it's used as the key/unique identifier that ties identity of the user in the IdM and the Access Control System to a User Access Right record in Allegion's cloud. While other claims in access tokens generated by your IdM may already contain the user email address (such as emailor subclaims), there is no standard or requirement that an IdM must use a specific claim to assert email address. Allegion uses a custom claim to enforce a standard approach for asserting user email since it's important and required

 

ℹ️ More on JWT Claims
JWT claims are the pieces of information that make up contents of a JWT and assert details about a user. For example, an ID token can contain a claim called name that asserts that the name of the user authenticating is "Isaac Bond". Claim represent information as name/value pairs where the name is a string and the value can be any valid JSON value. Custom claims are claims that are added to the JWT and arenot part of any standard.

 

Here's the structure of the custom claims that should be included in access JWTs when using this option:

"https://api.allegion.com/email": [email]
"https://api.allegion.com/integrationId": [integrationId]

Where [email] is replaced by the email address of the user identified by the accessJWT, and [integrationId] is replaced by the integrationId provided by Allegion.

The process for adding a custom claim to your access JWT will be different depending on the IdM you use.

If you happen to use Auth0 as your IdM provider, the recommended method for adding a custom claim is to add an Action to the Login Flow of your application with custom code to add the claim. Details on adding an action to the Login flow for an Auth0 application for Auth0 are detailed here and a demonstrable video is available here; you may use the following sample code as the basis for your login flow action:


/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {

  // This rule adds the authenticated user's email address to the access and id tokens.
  if (event.authorization) {

    const namespace = "https://api.allegion.com";

    api.accessToken.setCustomClaim(namespace+"/email", event.user.email);
    api.idToken.setCustomClaim(namespace+"/email", event.user.email);
	console.log("Adding custom claim -" + namespace+"/email:" + event.user.email);
  }
};

The code above defines an action that adds the custom claim to both the access token and ID token. It also outputs a message to the log regarding the additional claim value. If you're using Auth0 you can look at Auth0 logs to confirm your claim is being successfully processed:

Auth0 Logs

 

Step 9 - Build and run the app

Once you've completed all steps above, you are ready to build and run the app.


What do I do if the app displays the error "Authentication Error" after I log in?


If after logging into the app you are presented with the error, "Authentication Error Additional error detail is not available...", this is potentially due to a misconfiguration of the Employee Badge cloud environment, misconfiguration of your Android Studio environment variables or misconfiguration of your Auth0 environment. To check the cause of the issue, open Android Studio and review the latest log output for the following error:


{"errors":null,"errorCode":"IdTokenInvalid",
"type":"https://api.allegion.com/errors/producers/MahApi/errorcodes/IdTokenInvalid",
"details":"Invalid Open Id Token.","producerId":"MahApi","title":"The ID Token failed validation.",
"instance":null,"status":400}

This error points to a problem using the token obtained from the IdM to authorize the user as a valid PACS patron. To solve this problem you'll need to work with Allegion Customer Success to ensure your Employee Badge Cloud environment is properly configured based on the properties supplied to Allegion in the Request API Access step of this guide.


This error points to a problem using the token obtained from the IdM to authorize the user as a valid PACS patron. To solve this problem you'll need to work with Allegion Customer Success to ensure your Employee Badge Cloud environment is properly configured based on the properties supplied to Allegion in the Request API Access step of this guide.


Congratulations

If all steps were successfully complete you should be able to run your app. From here your credential will need to be provisioned in the Physical Access Control System (PACS) in order to be used, which may be similar to the process for provisioning physical credentials. PACS Configuration is unique to your environment and beyond the scope of this document.

 


Google Wallet Functional Testing and Certification

Google requires functional testing and certification to be completed for all implementations of mobile credentials before any production launch. The following table lists links to test and certification requirements for Google Wallet Mobile Credentials that will be required to be completed by partners before production certification and/or a site launch.

 

Note: If you receive a 404 or access denied page you must request access to the Google Wallet documentation as detailed above.

Vertical Test Guidelines
All Functional Testing Guidelines for All Verticals
Corporate Badge Corporate Badge Testing Checklist
Campus ID Campus ID Testing Checklist
Multifamily TBD

 

 

Google Wallet Badge Branding Guidelines

Google maintains branding guidelines at the links below:

 

Vertical Branding Guidelines
Corporate Badge Corporate Badge Branding Guidelines
Campus ID Campus ID Branding Guidelines
Multifamily TBD