This guide focuses on the complete workflow for issuing HID Mobile Access passes for Bluetooth Low Energy (BLE) access.
Other pass types can be issued using similar methods:
- Issuing HID Mobile Access passes for Apple/Google Wallet
- Issuing PassFlow mobile passes for Apple/Google Wallet
- Issuing Apple Access mobile passes
Overview
HID Mobile Access uses an invitation-based workflow where:
- An admin requests a mobile credential for a person
- DoorFlow creates an invitation code via HID Origo
- The invitation code is sent to the person (via email or API)
- The person accepts the invitation in the HID Mobile Access app
- HID Origo provisions the credential to their device
- The credential syncs with DoorFlow's access control channels
All interaction with HID services is handled by DoorFlow to ensure a consistent flow for all credential types.
Sequence Diagram
This diagram shows two approaches - pass issuance triggered from the DoorFlow UI and pass issuance triggered via the API:
Key Participants
- Person - The end user receiving access
- HID Mobile SDK - Resides inside the app being used for access (HID Mobile Access app or 3rd party app with HID Mobile Access SDK)
- HID Origo - HID's service infrastructure responsible for provisioning credentials to the SDK
- DoorFlow - The access control platform managing connections between all parties
- Client App - Your application that integrates with DoorFlow
- DoorFlow Admin UI - Interface for customer staff to manage access control
Implementation Approaches
Approach 1: DoorFlow Handles Email Delivery
DoorFlow automatically emails the invitation code to the person.
Configuration
When to use
API Flow:
# 1. Create person (if not exists)
POST /api/3/people
{
"person": {
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"enabled": true
}
}
# 2. Create HID Mobile Access credential
POST /api/3/people/{person_id}/credentials
{
"person_credential": {
"credential_type_id": 8,
"enabled": true
}
}
# Response includes credential_id with status 'invited'
# DoorFlow automatically emails invitation code to jane@example.com
Approach 2: Your App Handles Delivery
You retrieve the invitation code and send it via your own channels.
When to use
API Flow:
# 1. Create person (email optional)
POST /api/3/people
{
"person": {
"first_name": "Jane",
"last_name": "Smith",
"enabled": true
}
}
# 2. Create HID Mobile Access credential
POST /api/3/people/{person_id}/credentials
{
"person_credential": {
"credential_type_id": 8,
"enabled": true
}
}
# 3. Retrieve invitation code
GET /api/3/people/{person_id}/credentials/{credential_id}
# Response includes invitation_code field
{
"id": "cred_abc123",
"credential_type_id": 8,
"status": "invited",
"invitation_code": "ABC-DEF-GHI-JKL",
"person_id": 12345
}
# 4. Send invitation code via your preferred method
# - Email via your email service
# - SMS via your SMS provider
# - In-app notification
# - QR code display
Credential Status Lifecycle
HID Mobile Access credentials go through several statuses:
- invited - Invitation code created, waiting for person to accept
- provisioning - Person accepted invitation, credential being provisioned to device
- active - Credential successfully provisioned and working
- revoking - Revocation requested, being removed from device
- revoked - Credential removed from device and DoorFlow
Monitor via webhooks:
{
"event": "credential.status_changed",
"credential_id": "cred_abc123",
"person_id": 12345,
"old_status": "invited",
"new_status": "active",
"timestamp": "2024-01-15T14:30:00Z"
}
Person Acceptance Flow
Using HID Mobile Access App
- Person receives invitation code (via email or your app)
- Opens HID Mobile Access app
- Enters invitation code
- App contacts HID Origo to verify code
- Credential provisioned to device
- DoorFlow receives notification of successful provisioning
- Access granted at physical doors
Using Your Custom App (with HID SDK)
If you've integrated the HID Mobile Access SDK into your own app:
- Person opens your app
- App displays invitation code or prompts user to accept
- Your app calls HID SDK with invitation code
- SDK provisions credential to device
- Rest of flow is the same
Best Practices
Always Monitor Credential Status
Don't assume invitation was accepted. Monitor status changes:
# Poll for status changes
GET /api/3/people/{person_id}/credentials/{credential_id}
# Or better: Use webhooks
POST /api/3/webhooks
{
"url": "https://your-app.com/webhooks/doorflow",
"events": ["credential.status_changed"]
}
Set Expiration for Invitations
If invitation isn't accepted within reasonable time (e.g., 7 days):
- Send reminder
- Resend invitation
- Contact person directly
- Consider alternative credential type
Provide Clear Instructions
When delivering invitation codes, include:
- What app to download (HID Mobile Access or your custom app)
- Where to enter the code
- Expected timeline (usually provisions in seconds)
- Who to contact if issues arise
- Backup access method (PIN) in case of problems
Handle Revocation Properly
When removing HID Mobile Access credentials:
# Delete credential
DELETE /api/3/people/{person_id}/credentials/{credential_id}
# Credential enters 'revoking' status
# Wait for 'revoked' webhook before confirming to user
# This ensures pass is removed from device
Troubleshooting
Credential stuck in 'invited' status
Person hasn't accepted invitation. Check:
- Did they receive the invitation code?
- Do they have the correct app installed?
- Is the invitation code still valid?
- Did they enter it correctly?
Credential stuck in 'provisioning' status
Provisioning process interrupted. Options:
- Wait 5-10 minutes and check again
- Person should restart HID Mobile Access app
- Check HID Origo service status
- Contact DoorFlow support if persists
Credential status 'active' but not working at doors
Credential provisioned but not synced to readers:
- Check person has group membership with door access
- Verify person is enabled (
enabled: true) - Check reader is online and supports HID Mobile Access
- Wait a few minutes for credential sync to complete
- Check DoorFlow events for rejected access attempts
Person got new phone, how to transfer credential?
Cannot transfer mobile credentials between devices:
- Revoke old credential
- Issue new invitation for new device
- Person accepts on new device
# 1. Delete old credential
DELETE /api/3/people/{person_id}/credentials/{old_credential_id}
# 2. Create new credential
POST /api/3/people/{person_id}/credentials
{
"person_credential": {
"credential_type_id": 8,
"enabled": true
}
}
Security Considerations
Invitation Code Delivery
Invitation codes are sensitive:
- Treat like temporary passwords
- Use secure delivery channels (encrypted email, HTTPS API)
- Don't log invitation codes
- Expire unused invitations after reasonable time
Webhook Verification
Always verify webhook signatures to ensure requests are from DoorFlow:
// Example webhook verification
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(digest)
);
}
Quick Reference
Create HID Mobile Access credential:
POST /api/3/people/{person_id}/credentials
Body: {
"credential_type_id": 8,
"enabled": true
}
Retrieve invitation code:
GET /api/3/people/{person_id}/credentials/{credential_id}
# Returns: { "invitation_code": "ABC-DEF-GHI-JKL", "status": "invited" }
Check credential status:
GET /api/3/people/{person_id}/credentials/{credential_id}
# Returns: { "status": "invited|provisioning|active|revoking|revoked" }
Revoke credential:
DELETE /api/3/people/{person_id}/credentials/{credential_id}
Required OAuth scope: account.person