Account linking is usually performed when a user authenticates into each of their accounts to prove ownership (and to release attributes to the linking service). In some cases a user may not have (or remember they have) an account at an institution and need to go through an identity verification process to release the institutional attributes to link. This document describes how such a campus-hosted ID verification service integrates with the Cirrus account linking proxy. (Note: Cirrus Identity can host the ID Verify application if the campus provides an API)
A JWT (pronounced jot) is a secure way to construct and exchange claims/attributes between services and is what Cirrus uses for letting a campus-hosted ID Verification service securely send a user's identifier to the account linking proxy. A JWT specification is part of OpenID Connect and OAuth and there is wide support across programming languages. A JWT contains a JSON structure, and the ID verification service will add any attributes to the JSON and then sign it.
You can learn more about JWTs at https://jwt.io/
Once the campus ID verification service has verified a user's identity and determined their attributes/identifiers it will construct a JWT. The JWT will contains the identifiers/attributes to send to Cirrus and some metadata. The campus' ID verify service will then sign the JWT with its private key and redirect the user to the Cirrus Identity account linking proxy. The redirect will contain the JWT in a query parameter called idVerifyToken. The Cirrus account linking proxy will then validate the JWT and extract the user's identifiers and link those to their social account.
The JWT must be signed using asymmetric keys and the RS256 algorithm.
The user should be sent to https://TENANT_ID.proxy.cirrusidentity.com/module.php/cirrusaccountlink/link.php?idVerifyToken=JWT
These attributes (or claims in JWT parlance) are set regardless of the number identifiers sent
For an ID verification service that has a single identifier, that identifier should be placed into the sub claim.
For an ID verification service that wants to return multiple identifiers:
Header
{ "typ": "JWT", "alg": "RS256", "kid": "k1" } |
Payload
{ "aud": "tenantId", "iat": 1501082956, "exp": 1501083256, "jti": "b93efe6c-d18d-4075-a60f-cd268bf9a4db", "sub": "uniqueId", "cirrusAttributes": { "eduPersonUniqueId" : "uniqueId@scope", "name" : "name", "dirId" : "3453453", "applicantId" :"teadfsaeth" } } |
The Cirrus Identity account linking proxy will then be able to assert these attributes during authentication.
The ID Verification Service should sign the JWT using the RS256 (RSA using SHA-256 hash) algorithm.
Your ID Verification Service will need to generate asymmetric keys and share the public key with Cirrus.
openssl genrsa -out key1.pem 2048
openssl rsa -in key1.pem -outform PEM -pubout -out key1.crt
The Key Id (kid) is an identifier that your ID Verification service puts into the header to help Cirrus identify the key used to sign the JWT. Customers generally pick names like 'prod1', 'prod2' or 'dev1' to distinguish between their keys and environments.
The account linking proxy validates the JWT in the following way: