Package org.keycloak.credential
Class CredentialTypeMetadata
- java.lang.Object
- 
- org.keycloak.credential.CredentialTypeMetadata
 
- 
- All Implemented Interfaces:
- Comparable<CredentialTypeMetadata>
 
 public class CredentialTypeMetadata extends Object implements Comparable<CredentialTypeMetadata> - Author:
- Marek Posolda
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classCredentialTypeMetadata.Categorystatic classCredentialTypeMetadata.CredentialTypeMetadataBuilder
 - 
Field SummaryFields Modifier and Type Field Description static StringDEFAULT_ICON_CSS_CLASS
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CredentialTypeMetadata.CredentialTypeMetadataBuilderbuilder()intcompareTo(CredentialTypeMetadata other)CredentialTypeMetadata.CategorygetCategory()StringgetCreateAction()StringgetDisplayName()StringgetHelpText()StringgetIconCssClass()Return the icon CSS, which can be used to display icon, which represents this particular authenticator.StringgetType()StringgetUpdateAction()booleanisRemoveable()
 
- 
- 
- 
Field Detail- 
DEFAULT_ICON_CSS_CLASSpublic static final String DEFAULT_ICON_CSS_CLASS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getTypepublic String getType() - Returns:
- credential type like for example "password", "otp" or "webauthn"
 
 - 
getDisplayNamepublic String getDisplayName() - Returns:
- the label, which will be shown to the end user on various screens, like login screen with available authentication mechanisms. This label will reference this particular authenticator type. It should be clear to end users. For example, implementations can return "Authenticator Application" for OTP or "Security Key" for WebAuthn. Alternatively, this method can return a message key, so that it is possible to localize it for various languages.
 
 - 
getHelpTextpublic String getHelpText() - Returns:
- the text, which will be shown to the user on various screens, like login screen with available authentication mechanisms. This text will reference this particular authenticator type. For example for OTP, the returned text could be "Enter a verification code from authenticator application" . Alternatively, this method can return a message key, so that it is possible to localize it for various languages.
 
 - 
getIconCssClasspublic String getIconCssClass() Return the icon CSS, which can be used to display icon, which represents this particular authenticator. The icon will be displayed on various places. For example the "Select authenticator" screen during login, where user can select from various authentication mechanisms for two-factor or passwordless authentication. The returned value can be either: - Key of the property, which will reference the actual CSS in the themes.properties file. For example if you return "kcAuthenticatorWebAuthnClass" from this method, then your themes.properties should have the property like for example "kcAuthenticatorWebAuthnClass=fa fa-key list-view-pf-icon-lg" . This would mean that "fa fa-key list-view-pf-icon-lg" will be the actual CSS used. - the icon CSS class directly. For example you can return "fa fa-key list-view-pf-icon-lg" directly for the above example with WebAuthn. This alternative is fine just if your authenticator can use same CSS class for all the themes. If you don't expect your authenticator to need icon (for example it will never be shown in the "select authenticator" screen), then it is fine to keep the default value.
 - 
getCreateActionpublic String getCreateAction() - Returns:
- the providerID of the required action, which can be used by the user to create new credential of our type. Null if there is no action for creating credential. For example we're creating credential in case of "otp" type, but we're updating credential in case of type "password"
 
 - 
getUpdateActionpublic String getUpdateAction() - Returns:
- the providerID of the required action, which can be used by the user to update credential of our type. Null if there is no action for updating credential. For example we're creating credential in case of "otp" type, but we're updating credential in case of type "password"
 
 - 
isRemoveablepublic boolean isRemoveable() - Returns:
- true if user can remove some previously registered credentials of this type.
 
 - 
getCategorypublic CredentialTypeMetadata.Category getCategory() - Returns:
- Category of this credential
 
 - 
builderpublic static CredentialTypeMetadata.CredentialTypeMetadataBuilder builder() 
 - 
compareTopublic int compareTo(CredentialTypeMetadata other) - Specified by:
- compareToin interface- Comparable<CredentialTypeMetadata>
 
 
- 
 
-