Package org.keycloak.utils
Class CredentialHelper
- java.lang.Object
- 
- org.keycloak.utils.CredentialHelper
 
- 
 public class CredentialHelper extends Object used to set an execution a state based on type.- Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Constructor SummaryConstructors Constructor Description CredentialHelper()
 - 
Method Summary
 
- 
- 
- 
Method Detail- 
setRequiredCredentialpublic static void setRequiredCredential(KeycloakSession session, String type, RealmModel realm) 
 - 
setAlternativeCredentialpublic static void setAlternativeCredential(KeycloakSession session, String type, RealmModel realm) 
 - 
setOrReplaceAuthenticationRequirementpublic static void setOrReplaceAuthenticationRequirement(KeycloakSession session, RealmModel realm, String type, AuthenticationExecutionModel.Requirement requirement, AuthenticationExecutionModel.Requirement currentRequirement) 
 - 
getConfigurableAuthenticatorFactorypublic static ConfigurableAuthenticatorFactory getConfigurableAuthenticatorFactory(KeycloakSession session, String providerId) 
 - 
createOTPCredentialpublic static boolean createOTPCredential(KeycloakSession session, RealmModel realm, UserModel user, String totpCode, OTPCredentialModel credentialModel) Create OTP credential either in userStorage or local storage (Keycloak DB)- Returns:
- true if credential was successfully created either in the user storage or Keycloak DB. False if error happened (EG. during HOTP validation)
 
 - 
deleteOTPCredentialpublic static void deleteOTPCredential(KeycloakSession session, RealmModel realm, UserModel user, String credentialId) 
 - 
createUserStorageCredentialRepresentationpublic static CredentialRepresentation createUserStorageCredentialRepresentation(String credentialProviderType) Create "dummy" representation of the credential. Typically used when credential is provided by userStorage and we don't know further details about the credential besides the type- Parameters:
- credentialProviderType-
- Returns:
- dummy credential
 
 
- 
 
-