-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add authorization_details field to consent requested details #142
Open
sam-muncke
wants to merge
16
commits into
master
Choose a base branch
from
FGI-929_ciba_with_rar
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.
Description
This change adds support for using Rich Authorization Requests (RAR) with the Client Initiated Backchannel Authentication (CIBA) flow. This entails including the
authorization_details
parameter on the initial authentication request to the AS containing rich JSON objects with a pre-registeredtype
field. Thesesauthorization_details
are then contained in the rich-consents object retrieved by Guardian SDK for rendering to the user during the CIBA flow.This change modifies the Guardian
ConsentRequestedDetails
response object to include anauthorization_details
array property. Sinceauthorization_details
can be essentially arbitrary JSON, this PR also implements Json struct to represent it since the concrete type may not be known at compile time. It does this in preference to a more basic construct such as Dictionary<String,Any> as the type must be codable to deserialize the response and it also provides a nicer api for inspecting the content of the object.In addition, to facilitate the scenario where the concrete type of the
authorization_details
is known at compile time, a generic helper functionfilterAuthorizationDetailsByType
has also been implemented to provide strongly typed access to these objects where possible.Examples have been added to the sample app demonstrating usage of each of these methods of querying the
authorization_details
. One example renders a well-known strongly typed examplePaymentInitiation
type (this type was taken from the examples in the spec here), the second dynamically renders the properties of an unknown type.References
Testing
Covered by unit and integration tests. To test e2e:
Requires CIBA flow and CIBA flow with RAR enabled for you Auth0 tenant.
Enable CIBA grant on your Auth0 application under application settings.
Register RAR
authorization_details
types on the relevant audience API under API settingsUsing the TestApp included in this repo, configure Guardian MFA for iOS using APNs
Enroll the device for a user
Initiate a CIBA auth request with and
authorization_details
parameter (of types that you pre-registered on the API)Device should receive a push notification, rendering a consent panel with the CIBA binding message and the authorization_details properties.
This change adds test coverage for new/changed/fixed functionality
Checklist