-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
enhancement
Copy link
Labels
area/oid4vcIssue related to OpenID for Verifiable CredentialsIssue related to OpenID for Verifiable Credentialskind/enhancementCategorizes a PR related to an enhancementCategorizes a PR related to an enhancementrelease/26.6.0team/core-clients
Description
Description
Currently we send a CredentialOffer request like this ...
CredentialOfferResponse credentialOfferResponse = oauth.oid4vc()
.credentialOfferRequest()
.endpoint(offerUri)
.send();
int statusCode = credentialOfferResponse.getStatusCode();
if (HttpStatus.SC_OK != statusCode) {
throw new IllegalStateException(credentialOfferResponse.getErrorDescription() != null
? credentialOfferResponse.getErrorDescription()
: "Request failed with status " + statusCode);
}
CredentialsOffer credOffer = credentialOfferResponse.getCredentialsOffer();
or
CredentialOfferResponse credentialOfferResponse = oauth.oid4vc()
.credentialOfferRequest()
.nonce(credOfferUri.getNonce())
.send();
int statusCode = credentialOfferResponse.getStatusCode();
if (HttpStatus.SC_OK != statusCode) {
throw new IllegalStateException(credentialOfferResponse.getErrorDescription() != null
? credentialOfferResponse.getErrorDescription()
: "Request failed with status " + statusCode);
}
This code has several issues ...
- It (again often) relies on constructing the endpoint Url externally
- From a Wallet perspective - it has the complete offerUrl (nonce is a Keycloak proprietary thing)
- From our test API perspective we have the CredentialOfferURI, which can be used directly
- error handling should not have to be duplicated for every request
Value Proposition
- use credential offer url or CredentialOfferURI directly
- error handling by CredentialOfferResponse
Goals
Cleaner and more reliable code
Non-Goals
--
Discussion
No response
Notes
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/oid4vcIssue related to OpenID for Verifiable CredentialsIssue related to OpenID for Verifiable Credentialskind/enhancementCategorizes a PR related to an enhancementCategorizes a PR related to an enhancementrelease/26.6.0team/core-clients