Class PasswordVerificator

  • All Implemented Interfaces:
    pl.edu.icm.unity.engine.api.authn.CredentialExchange, pl.edu.icm.unity.engine.api.authn.CredentialVerificator, pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator, pl.edu.icm.unity.engine.api.utils.StringConfigurable, PasswordExchange, pl.edu.icm.unity.types.DescribedObject, pl.edu.icm.unity.types.NamedObject

    public class PasswordVerificator
    extends pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
    implements PasswordExchange
    Ordinary password credential verificator. Supports all settings from PasswordCredential.

    Additionally configuration of the credential may allow for password reset feature. Then are stored email verification settings, security question settings and confirmation code length.

    Author:
    K. Benedyczak
    See Also:
    PasswordCredential
    • Constructor Detail

      • PasswordVerificator

        @Autowired
        public PasswordVerificator​(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer,
                                   pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper,
                                   Optional<PasswordEncodingPoolProvider> threadPoolProvider)
    • Method Detail

      • getSerializedConfiguration

        public String getSerializedConfiguration()
                                          throws pl.edu.icm.unity.exceptions.InternalException
        Specified by:
        getSerializedConfiguration in interface pl.edu.icm.unity.engine.api.utils.StringConfigurable
        Throws:
        pl.edu.icm.unity.exceptions.InternalException
      • setSerializedConfiguration

        public void setSerializedConfiguration​(String json)
                                        throws pl.edu.icm.unity.exceptions.InternalException
        Specified by:
        setSerializedConfiguration in interface pl.edu.icm.unity.engine.api.utils.StringConfigurable
        Throws:
        pl.edu.icm.unity.exceptions.InternalException
      • prepareCredential

        public String prepareCredential​(String rawCredential,
                                        String currentCredential,
                                        boolean verify)
                                 throws pl.edu.icm.unity.exceptions.IllegalCredentialException,
                                        pl.edu.icm.unity.exceptions.InternalException
        The rawCredential must be in JSON format, see PasswordToken for details.
        Specified by:
        prepareCredential in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Throws:
        pl.edu.icm.unity.exceptions.IllegalCredentialException
        pl.edu.icm.unity.exceptions.InternalException
      • invalidate

        public String invalidate​(String currentCredential)
        Specified by:
        invalidate in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
      • checkCredentialState

        public pl.edu.icm.unity.types.authn.CredentialPublicInformation checkCredentialState​(String currentCredential)
                                                                                      throws pl.edu.icm.unity.exceptions.InternalException
        Specified by:
        checkCredentialState in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Throws:
        pl.edu.icm.unity.exceptions.InternalException
      • updateCredentialAfterConfigurationChange

        public Optional<String> updateCredentialAfterConfigurationChange​(String currentCredential)
        Specified by:
        updateCredentialAfterConfigurationChange in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Overrides:
        updateCredentialAfterConfigurationChange in class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
      • checkPassword

        public pl.edu.icm.unity.engine.api.authn.AuthenticationResult checkPassword​(String username,
                                                                                    String password,
                                                                                    String formForUnknown,
                                                                                    boolean enableAssociation,
                                                                                    pl.edu.icm.unity.engine.api.authn.remote.AuthenticationTriggeringContext triggeringContext)
        Checks if the provided password is valid. If it is then it is checked if it is still fulfilling all actual rules of the credential's configuration. If not then it is returned that credential state is outdated.
        Specified by:
        checkPassword in interface PasswordExchange
      • getCredentialResetBackend

        public pl.edu.icm.unity.engine.api.authn.CredentialReset getCredentialResetBackend()
        Specified by:
        getCredentialResetBackend in interface PasswordExchange
        Returns:
        credential reset backend
      • isCredentialDefinitionChagneOutdatingCredentials

        public boolean isCredentialDefinitionChagneOutdatingCredentials​(String newCredentialDefinition)
        Specified by:
        isCredentialDefinitionChagneOutdatingCredentials in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
      • getCharacteristicsRules

        public static List<edu.vt.middleware.password.CharacterRule> getCharacteristicsRules()
      • getSequencesRules

        public static List<edu.vt.middleware.password.Rule> getSequencesRules()
      • isCredentialSet

        public boolean isCredentialSet​(pl.edu.icm.unity.types.basic.EntityParam entity)
                                throws pl.edu.icm.unity.exceptions.EngineException
        Specified by:
        isCredentialSet in interface pl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
        Throws:
        pl.edu.icm.unity.exceptions.EngineException