-
Notifications
You must be signed in to change notification settings - Fork 66
feat(core): add OAuth2 consent flow support #584
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
base: main
Are you sure you want to change the base?
Conversation
- Add getConsentFlow, acceptConsentRequest, rejectConsentRequest in @ory/nextjs - Add consent page and API routes for app-router, pages-router, custom-components - Display OAuth2 client logo and subtitle on login/registration cards - Add ConsentFooter and custom scope checkbox for custom-components example - Export getConsentNodeKey, isFooterNode, isUiNodeInput, UiNodeInput utilities - Optimize rewriteUrls to single-pass replacement with OAuth2 path exclusion - Add null/undefined handling in rewriteJsonResponse - Add unit tests for consent utilities, card-consent functions, and rewrite
…consent flows Add shared utility getConfigWithOAuth2Logo to override project logo with OAuth2 client logo when available. Apply to Login, Registration, and Consent flows to display the OAuth2 client's logo during OAuth2-initiated flows.
|
|
@Jorgagu is attempting to deploy a commit to the ory Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #584 +/- ##
===========================================
+ Coverage 42.43% 55.61% +13.18%
===========================================
Files 136 177 +41
Lines 2008 3278 +1270
Branches 288 481 +193
===========================================
+ Hits 852 1823 +971
- Misses 1149 1387 +238
- Partials 7 68 +61
🚀 New features to boost your workflow:
|
|
@vinckr @jonas-jonas @aeneasr Happy New Year ! 🎉 Could you please review this one ? |
|
hi @Jorgagu, thank you very much for this contribution, and happy new year! We'll take a look at this in the coming weeks. We do have some code for this already; it just wasn't ready to be published, so we might need to do some merging with that. And just a heads-up, we're quite busy ramping up after the holidays again, so it might take a couple days longer for us to get to this. |
Add complete OAuth2 consent flow support to
@ory/nextjsand@ory/elements-reactpackages, enabling applications to handle OAuth2 authorization consent screens with Ory Hydra.Related Issue or Design Document
Fixex #327
Add complete OAuth2 consent flow support to
@ory/nextjsand@ory/elements-reactpackages, enabling applications to handle OAuth2 authorization consent screens with Ory Hydra.Features
Consent Flow Utilities (
@ory/nextjs)getConsentFlow- Fetch consent challenge from Ory HydraacceptConsentRequest- Accept consent with selected scopesrejectConsentRequest- Reject consent requestOAuth2 Client Logo Display
getConfigWithOAuth2Logoutility for consistent behaviorExample Implementations
Exported Utilities
getConsentNodeKey,isFooterNodefrom card-consentisUiNodeInput,UiNodeInputtype helpersImprovements
rewriteUrlsto single-pass regex replacementrewriteJsonResponseTests
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.sh) from the maintainers to push the changes.
Further comments
This implementation follows the pattern established in kratos-selfservice-ui-node for handling OAuth2 flows. The OAuth2 client logo is displayed by overriding the project configuration's
logo_light_urlwhen an OAuth2 client logo is available, keeping the existingDefaultCardLogocomponent unchanged.