-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add CORS support to OIDC dynamic client registration endpoints #43625
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
server-spi-private/src/main/java/org/keycloak/http/simple/SimpleHttpRequest.java
Dismissed
Show dismissed
Hide dismissed
c24430b to
3f2ba02
Compare
Closes keycloak#8863 Signed-off-by: stianst <[email protected]>
3f2ba02 to
1388ae9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.federation.ldap.LDAPProvidersIntegrationTest#updateLDAPUsernameTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stianst I have one question inline. LGTM besides that.
| } | ||
|
|
||
| if (failOnInvalidOrigin) { | ||
| throw new ForbiddenException("Invalid origin"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ok from the backwards compatibility?
Just wondering about the use-case like:
- Initial access token (or registration access token) migrated from previous version. So without any
allowed-originsinside - Client registration request, which used
Originheader. The request was not necessarily sent from the browser SPA and hence there was not CORS error (even if CORS headers were not added in the response). Now it would be 403 returned.
At the same time, I am not sure if it is valid to assume that client-registration request can use Origin header even if not sent from the browser SPA. Is it rather a corner-case, which we can ignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Origin header should only be sent by browsers. There's no real way around this though as we need to fail the request if the origin isn't correct; otherwise the creation would go through, but the browser would block the response only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see. Hopefully this is not a problem and people not use Origin header from other clients than browsers.
Still need to update Admin UI to allow creating initial access tokens with allowed web origins.
Closes #8863
Signed-off-by: stianst [email protected]