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>getCredentialScopesForScopeParameter(ClientModel client, String scopeParam) Get the list of credential scopes associated with the given client and requested by the given scope parameter
-
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) -
getCredentialScopesForScopeParameter
public static List<CredentialScopeModel> getCredentialScopesForScopeParameter(ClientModel client, String scopeParam) Get the list of credential scopes associated with the given client and requested by the given scope parameter -
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
-