Class CredentialScopeUtils
java.lang.Object
org.keycloak.protocol.oid4vc.utils.CredentialScopeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialScopeModelfindCredentialScopeModelByConfigurationId(RealmModel realmModel, Supplier<Stream<ClientScopeModel>> supplier, String credConfigId) static CredentialScopeModelfindCredentialScopeModelByName(RealmModel realmModel, Supplier<Stream<ClientScopeModel>> supplier, String scope) static StringgetCredentialDisplayName(KeycloakSession session, UserModel user, CredentialScopeModel credScope) Return display name of the credential according to preferred locale of current user and according to "vc.display" attribute specified for current OID4VCI client scope.static List<CredentialScopeModel>getCredentialScopesForAuthorization(ClientModel client, AuthorizationEndpointRequest request) Get the list of credential scopes associated by the given and requested by the given authorization request
-
Method Details
-
findCredentialScopeModelByConfigurationId
public static CredentialScopeModel findCredentialScopeModelByConfigurationId(RealmModel realmModel, Supplier<Stream<ClientScopeModel>> supplier, String credConfigId) -
findCredentialScopeModelByName
public static CredentialScopeModel findCredentialScopeModelByName(RealmModel realmModel, Supplier<Stream<ClientScopeModel>> supplier, String scope) -
getCredentialScopesForAuthorization
public static List<CredentialScopeModel> getCredentialScopesForAuthorization(ClientModel client, AuthorizationEndpointRequest request) Get the list of credential scopes associated by the given and requested by the given authorization request -
getCredentialDisplayName
public static String getCredentialDisplayName(KeycloakSession session, UserModel user, CredentialScopeModel credScope) Return display name of the credential according to preferred locale of current user and according to "vc.display" attribute specified for current OID4VCI client scope. Will fallback to client scope name if client scope does not contain "vc.display" or if "vc.display" is incorrectly formatted- Parameters:
session- Keycloak sessionuser- usercredScope- OID4VCI client scope- Returns:
- user-friendly name of the VC localized in the preference of the current user
-