Interface CredentialHelper
public interface CredentialHelper
Allows for performing various credential related operations which needs to be handled internally,
not via the public API.
This interface is intended for an internal use, as it performs all operations without any authorization. It should be used by the authentication related components as credential validators or authenticators.
- Author:
- K. Benedyczak
-
Method Summary
Modifier and TypeMethodDescriptionGet credential definitions as mapboolean
isCredentialSet
(pl.edu.icm.unity.base.entity.EntityParam entity, String credentialId) Check if credential is setvoid
setCredential
(long entityId, String credentialName, String value, LocalCredentialVerificator handler) Updates the credential in DB.void
updateCredential
(long entityId, String credentialName, String dbEncodedCredentialState) Updates the credential in DB.
-
Method Details
-
updateCredential
void updateCredential(long entityId, String credentialName, String dbEncodedCredentialState) throws pl.edu.icm.unity.base.exceptions.EngineException Updates the credential in DB. This feature is required to perform a sort of callback: credentials may need to update themselves in DB, e.g. to invalidate them in case when it is detected during login that the current password is not valid anymore.IMPORTANT: the last argument must be given in a database format, i.e. must be already result of processing by an appropriate credential handler. Therefore this method is useful to be called from a verificator itself.
- Parameters:
entityId
-credentialName
-dbEncodedCredentialState
-- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
setCredential
void setCredential(long entityId, String credentialName, String value, LocalCredentialVerificator handler) throws pl.edu.icm.unity.base.exceptions.EngineException Updates the credential in DB. This is the same code asIdentitiesManagement#setEntityCredential(pl.edu.icm.unity.base.entity.EntityParam, String, String)
but requires no authorization.- Parameters:
entityId
-credentialName
-value
-- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
isCredentialSet
boolean isCredentialSet(pl.edu.icm.unity.base.entity.EntityParam entity, String credentialId) throws pl.edu.icm.unity.base.exceptions.EngineException Check if credential is set- Parameters:
entity
-credentialId
-- Returns:
- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
getCredentialDefinitions
Map<String,pl.edu.icm.unity.base.authn.CredentialDefinition> getCredentialDefinitions() throws pl.edu.icm.unity.base.exceptions.EngineExceptionGet credential definitions as map- Returns:
- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-