OpenID Connect (OIDC) is an authentication protocol based on the OAuth 2.0 specifications. While OAuth 2.0 is about resource access and sharing, OIDC is all about end-user authentication.
MIRACL Trust is a standards-compliant OpenID Connect provider. You can use any OIDC Relying Party Library to integrate with MIRACL Trust. For a list of certified OpenID Connect Libraries, see https://openid.net/developers/certified-openid-connect-implementations/.
To use Custom User Verification with OpenID Connect (OIDC), you must set up a Custom Verification URL in the MIRACL Trust Portal. This Custom Verification URL is needed for the verification of the User ID after the end user starts their registration. When the end user’s User ID is verified, you must request the Verification URL to be sent from the platform (as described in Implement the Verification).
Note: Custom Verification URL is different from Verification URL.
- Custom Verification URL is the registration URL in your system that you set up in the MIRACL Trust Portal.
- Verification URL is the platform-issued URL that is used to transfer the verification to the platform, finishing the verification flow.
If the registration is successful, the enrolment process is completed. End users can now authenticate using the PIN chosen for the device. They can go through the verification process for each device they want to use for authentication or use QuickCode, if enabled, to enrol additional devices using the already enrolled one.
# Implement the Verification
When the end user’s User ID is verified, you must request the Verification URL to be sent from the platform. The Verification URL is generated by making an authenticated POST request to https://api.mpin.io/verification.
curl \
--request POST \
--user "${YOUR_CLIENT_ID}:${YOUR_CLIENT_SECRET}" \
--data '{
"userId": "'"${USER_ID}"'",
"deviceName": "'"${DEVICE_NAME}"'",
"clientId": "'"${YOUR_CLIENT_ID}"'",
"redirectURI": "'"${YOUR_REDIRECT_URI}"'",
"expiration": "'"${EXPIRATION}"'",
"scope": ["openid", "email"],
"delivery": "no"
}' \
https://api.mpin.io/verification
With the following response:
{
"verificationURL": "https://api.mpin.io/verification/confirmation?user_id=<USER_ID>&code=<CODE>"
}
All values are redacted.
The end user must follow the URL from the response to enrol a new device.
See MIRACL Trust Backend API for more details.
# Flow
sequenceDiagram Client ->> RPA: Request protected resource RPA ->>+ MIRACL Trust Authorization Page: Redirect to MIRACL Trust OIDC Authorization Page for authentication opt User verification MIRACL Trust Authorization Page -->>+ RPA: Redirect to the Custom Verification URL on record RPA ->> RPA: Verify user RPA ->>- MIRACL API: Provide verification MIRACL API -->> RPA: Return Verification URL RPA -->> Client: Deliver Verification URL Client ->> MIRACL Trust Authorization Page: Open Verification URL MIRACL Trust Authorization Page ->> MIRACL Trust Authorization Page: Enrol device end MIRACL Trust Authorization Page ->> MIRACL Trust Authorization Page: Authenticate MIRACL Trust Authorization Page -->>- Client: Redirect to the OIDC Redirect URL on record Client ->> RPA: Request protected resource with proof of authentication RPA ->>+ MIRACL API: Exchange Access Code for ID Token and Access Token MIRACL API -->>- RPA: Return ID Token and Access Token RPA -->> Client: Provide protected resource
RPA stands for Relying Party Application; in this case, it is your application’s back end.
When a client requests access to a protected resource, the RPA redirects the end user to the MIRACL Trust Authorisation Page to begin authentication via OpenID Connect.
If the device is not yet registered, the end user is redirected to a Custom Verification URL. The RPA then handles the identity verification and sends it to the MIRACL Trust API, which returns a Verification URL. When the end user opens it, the verification is complete and the device is registered.
With the device registered, the end user can authenticate using the PIN associated with their registered device.
Once authentication is successful, the end user is directed to your OIDC Redirect URL along with the Access Code. The RPA then exchanges this Access Code for ID and Access tokens, confirming that the authentication was successful. This process may lead to creating a session on the back end, thereby granting the end user access to the protected resource.