[OID4VCI] Migrate OID4VCIssuerWellKnownProviderTest#47313
[OID4VCI] Migrate OID4VCIssuerWellKnownProviderTest#47313mposolda merged 1 commit intokeycloak:mainfrom
Conversation
46b0d63 to
8264287
Compare
Ogenbertrand
left a comment
There was a problem hiding this comment.
Hello @tdiesler !
Thanks for the PR, i left a few comments could you check them ?
| String acceptHeader = session.getContext().getRequestHeaders().getHeaderString(HttpHeaders.ACCEPT); | ||
| boolean preferJwt = acceptHeader != null && acceptHeader.contains(MediaType.APPLICATION_JWT); | ||
| boolean signedMetadataEnabled = Boolean.parseBoolean(realm.getAttribute(SIGNED_METADATA_ENABLED_ATTR)); | ||
| boolean signedMetadataEnabled = realm.getAttribute(SIGNED_METADATA_ENABLED_ATTR, true); |
There was a problem hiding this comment.
Defaulting this to true changes signed issuer metadata from opt-in to opt-out.
There was a problem hiding this comment.
Yes, and to be honest I don't quite understand why "opt-out" is even necessary. The caller decides (with the Accept header) which format they want.
Is there a reason why we would deny signed metadata when asked for?
There was a problem hiding this comment.
Thanks for the feedback @tdiesler !
This is my understanding of this part from the spec, I may be wrong please correct me.
Accept: application/jwt only tells the issuer that the wallet can consume signed metadata, it does not require the issuer to return it. In 11.2.2 the spec makes unsigned JSON mandatory and signed metadata optional: the issuer MUST support application/json, but only MAY support signed metadata, and matching the requested media type is only RECOMMENDED when supported. Then 11.2.3 treats signed metadata as a trust-bearing artifact that the wallet must validate and trust, so this is an issuer capability/policy choice, not just a formatting choice. Because of that, defaulting SIGNED_METADATA_ENABLED_ATTR to true is still a behavioral change from opt-in to opt-out, the spec allows signed metadata, but it does not require us to enable it by default.
There was a problem hiding this comment.
Sure, but we do support it. Hence, we can match the requested media type as RECOMMENDED. I'm looking for a valid reason on why it is beneficial to turn it off, is there?
There was a problem hiding this comment.
No further points thanks for clarifying me.
There was a problem hiding this comment.
What do we do here ? Leave it as is or remove SIGNED_METADATA_ENABLED_ATTR altogether?
There was a problem hiding this comment.
I'll say we should remove it SIGNED_METADATA_ENABLED_ATTR.
There was a problem hiding this comment.
+1 for remove SIGNED_METADATA_ENABLED_ATTR . In case that caller uses Accept: application/jwt request header, the response might be signed. With any other Accept header (or without Accept), it might be better to respond with unsigned response. That is also what is done by OIDC well-known endpoint AFAIK.
If the attribute is removed in this PR, it would be needed to update also admin console UI and remove the attribute from the UI and make sure that attributes like "Signed Metadata Lifespan" and "Signed Metadata Signing Algorithm" are always visible in the admin console UI
There was a problem hiding this comment.
+1 for remove
SIGNED_METADATA_ENABLED_ATTR. In case that caller usesAccept: application/jwtrequest header, the response might be signed. With any otherAcceptheader (or withoutAccept), it might be better to respond with unsigned response. That is also what is done by OIDC well-known endpoint AFAIK.If the attribute is removed in this PR, it would be needed to update also admin console UI and remove the attribute from the UI and make sure that attributes like "Signed Metadata Lifespan" and "Signed Metadata Signing Algorithm" are always visible in the admin console UI
I'll handle this in the UI @mposolda !
25d8e78 to
29b58fc
Compare
db5622d to
56cff44
Compare
|
@Ogenbertrand is this good to go or shall we remove SIGNED_METADATA_ENABLED_ATTR? |
mposolda
left a comment
There was a problem hiding this comment.
Added comment inline to the existing conversation.
| String acceptHeader = session.getContext().getRequestHeaders().getHeaderString(HttpHeaders.ACCEPT); | ||
| boolean preferJwt = acceptHeader != null && acceptHeader.contains(MediaType.APPLICATION_JWT); | ||
| boolean signedMetadataEnabled = Boolean.parseBoolean(realm.getAttribute(SIGNED_METADATA_ENABLED_ATTR)); | ||
| boolean signedMetadataEnabled = realm.getAttribute(SIGNED_METADATA_ENABLED_ATTR, true); |
There was a problem hiding this comment.
+1 for remove SIGNED_METADATA_ENABLED_ATTR . In case that caller uses Accept: application/jwt request header, the response might be signed. With any other Accept header (or without Accept), it might be better to respond with unsigned response. That is also what is done by OIDC well-known endpoint AFAIK.
If the attribute is removed in this PR, it would be needed to update also admin console UI and remove the attribute from the UI and make sure that attributes like "Signed Metadata Lifespan" and "Signed Metadata Signing Algorithm" are always visible in the admin console UI
95cdc3f to
784b037
Compare
Will be better to rather not merge this without UI work as then we effectively introduce bug by merging this PR (due the fact that admin console UI would have a switch with no functionality and meaning). @Ogenbertrand If it is OK for you, you can possibly cherry-pick commits by @tdiesler from this branch and add your commit(s) on top of it with updates to UI. Then you send the dedicated PR with both changes from this PR and UI changes. Then we can close this PR. Does this work? |
Just seeing that you already sent the UI PR #47515 :-) Addressing UI changes beforehand works as well instead of both changes (Server and UI) in the same PR. I hope I can merge this PR once UI PR #47515 is OK and merged. |
I missed this comment @mposolda, i'll focus on addressing any comment i recieve here: #47515 today, sorry i missed your message. |
e4de9d0 to
97ef3bc
Compare
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.forms.MultipleTabsLoginTest#testLoginAfterLogoutFromDifferentTabKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#loginActionWithoutExecutionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRequiredActionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#expiredAuthenticationAction_expiredCodeExpiredExecutionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testWithAuthSessionExpiredInTheMiddle_badRedirectUriKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testEmptyBaseUrlKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testRestartFailureWithDifferentClientAfterAuthSessionExpirationKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#expiredAuthenticationAction_currentCodeExpiredExecutionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testLogoutDifferentBrowserWithAuthenticationSessionStillPresentKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsLoginAndPassiveCheckKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredInTheMiddleKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#loginActionWithoutExecutionInRequiredActionsKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRefreshInTab1Keycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testLoginPageRefreshKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#loginWithDifferentClientsKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRegisterClickKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#expiredAuthenticationAction_expiredCodeCurrentExecutionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testInjectRedirectUriInClientDataAfterAuthSessionExpirationKeycloak CI - Forms IT (chrome) |
Signed-off-by: Thomas Diesler <[email protected]>
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.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabledKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) |
mposolda
left a comment
There was a problem hiding this comment.
@tdiesler @Ogenbertrand Thanks again for the updates and review!
closes #47296