Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tdiesler
Copy link
Contributor

@tdiesler tdiesler commented Jan 27, 2026

closes #45774

Instead of using low level Http requests, this PR adds support for OID4VCI requests using the well known OAuthClient request/response pattern like this ...

Rich AuthorizationRequest with AuthorizationDetails

This PR also adds support for ClientMetadata in the AuthorizationRequest

        AuthorizationRequest authRequest = new AuthorizationRequestBuilder()
                .withClientId(issClientId)
                .withAuthorizationDetail(authDetail)
                .withRedirectUri(redirectUri)
                .withCodeChallenge(pkce)
                .build();

        AuthorizationRequestResponse authResponse = new AuthorizationRequestRequest(oauth, authRequest)
                .credentials(ctx.targetUser, "password")
                .send();

If removes OID4VCAuthorizationDetailResponse in favor of OID4VCAuthorizationDetail with credential_identifiers (i.e. it should not be necessary to distinguish between the two)

Response status code checking is already done in the response base classes - I unified the error response handling like this, so that clients won't have to deal with it every time as part of a request.

    public CredentialResponse getCredentialResponse() {
        return Optional.ofNullable(credentialResponse).orElseThrow(() ->
                new IllegalStateException(String.format("[%s] %s", getError(), getErrorDescription())));
    }

AbstractHttpPostRequest now supports ...

  • arbitrary payloads (i.e. not just url-form-encoded)
  • bearer token authentication

Oid4vcCredentialRequest can extend it directly.

Copy link

@keycloak-github-bot keycloak-github-bot bot left a 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

@keycloak-github-bot
Copy link

Unreported flaky test detected

If 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.oid4vc.issuance.signing.LDCredentialSignerTest#testLdpSignedCredentialWithoutAdditionalClaims

Keycloak CI - Base IT (6)

org.keycloak.testsuite.runonserver.RunOnServerException: org.keycloak.protocol.oid4vc.issuance.signing.CredentialSignerException: Was not able to create a JsonLD Document from the serialized string.
	at org.keycloak.testsuite.client.KeycloakTestingClient$Server.run(KeycloakTestingClient.java:207)
	at org.keycloak.testsuite.oid4vc.issuance.signing.LDCredentialSignerTest.testLdpSignedCredentialWithoutAdditionalClaims(LDCredentialSignerTest.java:160)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
...

Report flaky test

@tdiesler tdiesler force-pushed the ghi45774 branch 8 times, most recently from 0d21915 to 94791fe Compare January 28, 2026 16:51
@tdiesler tdiesler changed the title [OID4VCI] Support oid4vci requests in OAuthClient [OID4VCI] Support rich AuthorizationRequest requests in OAuthClient Jan 28, 2026
@tdiesler tdiesler force-pushed the ghi45774 branch 3 times, most recently from cf14309 to 0faff82 Compare January 28, 2026 20:22
@tdiesler tdiesler marked this pull request as ready for review January 28, 2026 20:24
@tdiesler tdiesler changed the title [OID4VCI] Support rich AuthorizationRequest requests in OAuthClient [OID4VCI] Support AuthorizationRequest requests in OAuthClient Jan 29, 2026
@tdiesler tdiesler force-pushed the ghi45774 branch 2 times, most recently from 061454e to ddec941 Compare January 29, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OID4VCI] Support AuthorizationRequest requests in OAuthClient

1 participant