Skip to main content

User Authentication and Notifications

You can extend onboarding so that each managed instance is linked to a user account in your identity provider. Once an instance has a linked user, you can find instances by user and send that user notifications through the Notification Service.

This works the same way for Wallet Provider and Verifier Provider backends.

How it works​

  1. The app reads the settings. The provider metadata published by your provider backend includes the userAuthentication settings: identity provider, client ID, and redirect URI.

  2. The app registers. Registration returns the instance ID and a userNonce. The instance status is PENDING.

  3. The user signs in. The app authenticates the user with your identity provider.

  4. The app activates. The app calls activate with the user's userAccessToken and userIdToken, along with the app integrity proof.

  5. The provider backend validates. It validates the token against your tokenValidation settings, verifies the nonce, and stores the user's sub against the managed instance.

If required is true, users must complete authentication to activate their instance. If false, authentication is optional and the instance can activate without a linked user.

Configuring user authentication​

Add a userAuthentication block to your walletProvider or verifierProvider configuration. The block is the same for both:

walletProvider: # or verifierProvider
PROCIVIS_ONE:
type: PROCIVIS_ONE
params:
public:
userAuthentication:
required: true
identityProvider: keycloak
clientId: one-wallet
redirectUri: https://wallet.example.com/auth/callback
tokenValidation:
aud: one-wallet
iss: https://keycloak.example.com/realms/one
jwksUri: https://keycloak.example.com/realms/one/protocol/openid-connect/certs
ParameterDescription
requiredIf true, users must authenticate to activate their instance. If false, authentication is optional.
identityProviderThe identity provider the app authenticates users with.
clientIdThe client ID the app uses with the identity provider.
redirectUriThe redirect URI for the identity provider's authentication flow.
tokenValidation.audExpected audience of the token.
tokenValidation.issExpected issuer of the token.
tokenValidation.jwksUriWhere the provider backend fetches the identity provider's signing keys.

These settings are published to apps through the provider metadata, so keep them under params.public.

For the full configuration, see Configuring Wallet Provider Backend or Configuring Verifier Provider Backend.

Finding a user's instances​

The linked user is returned as userSub in the managed instance list and detail. To find all instances belonging to a user, filter by it:

GET /api/managed-instance/v1?userSub={sub}

Sending notifications​

The Notification Service is a separate service that sends template-based, translation-ready notifications to the users of your managed instances. Specify the recipient, the delivery channel, and the template; the service handles rendering and delivery.

POST /api/notification/v1/wallet-user

{
"channel": "EMAIL",
"user": "user-subject-id",
"template": {
"name": "CREDENTIAL_LOGIN_DEACTIVATED",
"locale": "EN"
}
}
FieldDescription
channelDelivery channel. Currently EMAIL.
userThe user's sub, as stored in userSub on the managed instance.
template.nameA pre-defined notification event, for example: CREDENTIAL_LOGIN_ACTIVATED, CREDENTIAL_LOGIN_DEACTIVATED, or CREDENTIAL_LOGIN_RESET. The message content is determined entirely by the template and locale.
template.localeThe language to render the notification in. Currently EN.
template.dataReserved for future templates that support dynamic values. Not currently used.

A successful call returns 204 No Content. There is no delivery confirmation or status polling.

EUDI Wallet Providers

EUDI Wallet Providers must inform users within 24 hours of revoking their wallet unit. You can reach those users if they have onboarded with user and you have configured the Notification Service. See EUDI Wallet Provider.