Package org.keycloak.broker.oid4vp
Class OID4VPIdentityProviderEndpoint
java.lang.Object
org.keycloak.broker.oid4vp.OID4VPIdentityProviderEndpoint
JAX-RS endpoint backing the OID4VP wallet flow, routed at
/realms/{realm}/broker/{alias}/endpoint.
GET /request-object/{handle}serves the signed authorization request object.POST /receives the wallet'sdirect_postpresentation, verifies it, and returns the browser redirect that finalizes login, or an empty JSON object for the cross device flow where the remote wallet cannot drive the browser.GET /statustells the polling login page whether the cross device presentation arrived.GET /complete-authresolves the deferred identity and hands control back to Keycloak.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOID4VPIdentityProviderEndpoint(KeycloakSession session, RealmModel realm, OID4VPIdentityProvider provider, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event) -
Method Summary
Modifier and TypeMethodDescriptionprotected RequestObjectbuildRequestObject(String state, RequestContext requestContext, boolean crossDevice) jakarta.ws.rs.core.ResponsecompleteAuth(String state, String responseCode) protected StringcompleteAuthUrl(String state, String responseCode) protected com.fasterxml.jackson.databind.JsonNodeprotected DecryptedResponsedecryptResponse(String response) jakarta.ws.rs.core.ResponsedirectPost(String vpToken, String state, String response, String flow) static jakarta.ws.rs.core.UriBuilderendpointBaseUri(jakarta.ws.rs.core.UriBuilder baseUriBuilder, String realmName, String alias) protected static jakarta.ws.rs.core.ResponseerrorResponse(jakarta.ws.rs.core.Response.Status status, String error, String description) protected static booleanisCrossDevice(String flow) protected jakarta.ws.rs.core.ResponseloginError(jakarta.ws.rs.core.Response.Status status, String error, String description, String eventError) protected jakarta.ws.rs.core.ResponseloginErrorPage(AuthenticationSessionModel authSession, String messageKey) jakarta.ws.rs.core.ResponserequestObject(String state, String flow) protected AuthenticationSessionModelresolveAuthSession(String rootSessionId, String tabId) protected StringresponseUri(boolean crossDevice) jakarta.ws.rs.core.Responseprotected static jakarta.ws.rs.core.ResponsestatusResponse(jakarta.ws.rs.core.Response.Status httpStatus, String status, String redirectUri) protected BrokeredIdentityContexttoBrokeredContext(SdJwtVpVerificationResult result, AuthenticationSessionModel authSession) protected SdJwtVpVerificationResultverifyPresentation(String vpToken, String nonce)
-
Field Details
-
REQUEST_OBJECT_PATH
- See Also:
-
COMPLETE_AUTH_PATH
- See Also:
-
STATUS_PATH
- See Also:
-
FLOW_PARAM
- See Also:
-
FLOW_CROSS_DEVICE
- See Also:
-
STATUS_KEY
- See Also:
-
STATUS_REDIRECT_URI_KEY
- See Also:
-
STATUS_PENDING
- See Also:
-
STATUS_COMPLETE
- See Also:
-
STATUS_EXPIRED
- See Also:
-
STATUS_ERROR
- See Also:
-
-
Constructor Details
-
OID4VPIdentityProviderEndpoint
public OID4VPIdentityProviderEndpoint(KeycloakSession session, RealmModel realm, OID4VPIdentityProvider provider, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event)
-
-
Method Details
-
requestObject
-
directPost
-
status
@GET @Path("/status") @Produces("application/json") public jakarta.ws.rs.core.Response status(@QueryParam("state") String state) -
completeAuth
-
buildRequestObject
protected RequestObject buildRequestObject(String state, RequestContext requestContext, boolean crossDevice) -
dcqlQuery
protected com.fasterxml.jackson.databind.JsonNode dcqlQuery() -
decryptResponse
- Throws:
VerificationException
-
verifyPresentation
protected SdJwtVpVerificationResult verifyPresentation(String vpToken, String nonce) throws VerificationException - Throws:
VerificationException
-
toBrokeredContext
protected BrokeredIdentityContext toBrokeredContext(SdJwtVpVerificationResult result, AuthenticationSessionModel authSession) -
resolveAuthSession
-
endpointBaseUri
-
responseUri
-
isCrossDevice
-
statusResponse
-
completeAuthUrl
-
loginError
-
loginErrorPage
protected jakarta.ws.rs.core.Response loginErrorPage(AuthenticationSessionModel authSession, String messageKey) -
errorResponse
-