Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for fetching rich consents #139

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

sam-muncke
Copy link

@sam-muncke sam-muncke commented Dec 10, 2024

Description

Adds the ability to retrieve additional consent information from Auth0's /rich-consents endpoint. This is required for certain flows such Client Initiated Backchannel Authentication (CIBA).

On receipt of a push notification, where required, additional consent can be obtained as follows:

Guardian
    .consent(forDomain: AppDelegate.guardianDomain, device: enrollment)
    .fetch(consentId: notification.transactionLinkingId, notificationToken: notification.transactionToken)
    .start{result in
        switch result {
        case .failure(let cause):
            // handle error
        case .success(let payload):
            // render consent information to user
    }
}

The user can then use the additional information in the consent record to decide whether to allow or reject the request.

Example of rich-consents binding message being rendered in the test app:

Requests to the /rich-consent endpoint require sender constraining via demonstrating proof of possession based on a modified version of the DPoP standard to ensure the access token is bound to the keys used for device enrollment. This change also extends the existing JWT encoding to be able to create a DPoP Proof JWT.

References

Testing

  1. Requires CIBA flow enabled for you Auth0 tenant (currently in Beta).
  2. Enable CIBA grant on your Auth0 application under application settings.
  3. Using the TestApp included in this repo, configure Guardian MFA for iOS using APNs
  4. Enroll the device for a user
  5. Initiate a CIBA auth request
  6. Device should receive a push notification, rendering a consent panel with the CIBA binding message.
  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@sam-muncke sam-muncke marked this pull request as ready for review December 11, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant