Class OID4VPIdentityProvider
- All Implemented Interfaces:
IdentityProvider<OID4VPIdentityProviderConfig>,TrustMaterialIdentityProvider<OID4VPIdentityProviderConfig>,UserAuthenticationIdentityProvider<OID4VPIdentityProviderConfig>,Provider
Supports the same device and cross device flows with a single SD-JWT VC. performLogin(org.keycloak.broker.provider.AuthenticationRequest)
renders a page with an openid4vp:// link for a wallet on this device and a QR code for a
wallet on another device. The wallet fetches a signed request object and posts the presentation
back to OID4VPIdentityProviderEndpoint, which verifies it and drives the normal broker
machinery (existing or new user, first and post broker login). A remote wallet cannot redirect
the browser, so the login page polls the endpoint until the presentation arrives.
The provider also acts as its own TrustMaterialIdentityProvider: the credential issuer
signature is verified against the inline JWKS configured on this provider.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
UserAuthenticationIdentityProvider.AuthenticationCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intFields inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
ACCOUNT_LINK_URL, BROKER_REGISTERED_NEW_USER, session, UPDATE_PROFILE_EMAIL_CHANGED, UPDATE_PROFILE_USERNAME_CHANGEDFields inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
EXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN -
Constructor Summary
ConstructorsConstructorDescriptionOID4VPIdentityProvider(KeycloakSession session, OID4VPIdentityProviderConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildWalletUrl(String clientId, URI requestUri) callback(RealmModel realm, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event) JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.clientId()protected ClientIdentifierprotected jakarta.ws.rs.core.UriBuilderendpointUri(AuthenticationRequest request) protected intjakarta.ws.rs.core.ResponseperformLogin(AuthenticationRequest request) Initiates the authentication process by sending an authentication request to an identity provider.protected URIrequestUri(AuthenticationRequest request, String state, boolean crossDevice) resolveKeys(TrustMaterialRequest request) jakarta.ws.rs.core.ResponseretrieveToken(KeycloakSession session, FederatedIdentityModel identity) Returns aResponsecontaining the token previously stored during the authentication process for a specific user.jakarta.ws.rs.core.ResponseretrieveToken(KeycloakSession session, FederatedIdentityModel identity, UserSessionModel userSession, UserModel user) Returns aResponsecontaining the token previously stored during the authentication process for a specific user.protected StringstatusUrl(AuthenticationRequest request, String state) protected TrustedSdJwtIssuerResolverMethods inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
authenticationFinished, backchannelLogout, buildTokenResponse, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, getConfig, getFederatedAccessToken, getFederatedAccessTokenKey, getFederatedTokenNote, getLinkingUrl, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, setEmailVerified, setFederatedAccessToken, setFederatedAccessToken, updateBrokeredUser, updateEmailMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.broker.provider.IdentityProvider
export, getConfig, isMapperSupported, isType, reloadKeysMethods inherited from interface org.keycloak.broker.provider.TrustMaterialIdentityProvider
resolveX509TrustMethods inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
supportsLongStateParameter
-
Field Details
-
ACCEPTED_ALGORITHMS
-
CONTEXT_PREFIX
- See Also:
-
DEFERRED_PREFIX
- See Also:
-
IDENTITY_NOTE
- See Also:
-
KEY_ROOT_SESSION_ID
- See Also:
-
KEY_TAB_ID
- See Also:
-
KEY_STATE
- See Also:
-
KEY_RESPONSE_CODE
- See Also:
-
KEY_CROSS_DEVICE
- See Also:
-
QR_CODE_SIZE
public static final int QR_CODE_SIZE- See Also:
-
-
Constructor Details
-
OID4VPIdentityProvider
-
-
Method Details
-
performLogin
Description copied from interface:UserAuthenticationIdentityProviderInitiates the authentication process by sending an authentication request to an identity provider. This method is called only once during the authentication.
- Specified by:
performLoginin interfaceUserAuthenticationIdentityProvider<OID4VPIdentityProviderConfig>- Overrides:
performLoginin classAbstractIdentityProvider<OID4VPIdentityProviderConfig>- Parameters:
request- The initial authentication request. Contains all the contextual information in order to build an authentication request to the identity provider.- Returns:
-
callback
public Object callback(RealmModel realm, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event) Description copied from interface:UserAuthenticationIdentityProviderJAXRS callback endpoint for when the remote IDP wants to callback to keycloak.- Specified by:
callbackin interfaceUserAuthenticationIdentityProvider<OID4VPIdentityProviderConfig>- Overrides:
callbackin classAbstractIdentityProvider<OID4VPIdentityProviderConfig>- Returns:
-
resolveKeys
- Specified by:
resolveKeysin interfaceTrustMaterialIdentityProvider<OID4VPIdentityProviderConfig>
-
trustedIssuerResolver
-
retrieveToken
public jakarta.ws.rs.core.Response retrieveToken(KeycloakSession session, FederatedIdentityModel identity) Description copied from interface:UserAuthenticationIdentityProviderReturns a
Responsecontaining the token previously stored during the authentication process for a specific user. Deprecated method used for Identity Brokering API V1 that only uses the database.- Specified by:
retrieveTokenin interfaceUserAuthenticationIdentityProvider<OID4VPIdentityProviderConfig>- Returns:
-
retrieveToken
public jakarta.ws.rs.core.Response retrieveToken(KeycloakSession session, FederatedIdentityModel identity, UserSessionModel userSession, UserModel user) Description copied from interface:UserAuthenticationIdentityProviderReturns a
Responsecontaining the token previously stored during the authentication process for a specific user. This method looks in the user session and in the database if not present.- Specified by:
retrieveTokenin interfaceUserAuthenticationIdentityProvider<OID4VPIdentityProviderConfig>- Returns:
-
signingKey
-
clientIdentifier
-
clientId
-
requestUri
-
statusUrl
-
endpointUri
-
buildWalletUrl
-
loginTimeoutSeconds
protected int loginTimeoutSeconds()
-