Class SMSVerificator
java.lang.Object
pl.edu.icm.unity.engine.api.authn.AbstractVerificator
pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
pl.edu.icm.unity.stdext.credential.sms.SMSVerificator
- All Implemented Interfaces:
pl.edu.icm.unity.base.describedObject.DescribedObject,pl.edu.icm.unity.base.describedObject.NamedObject,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,SMSExchange
public class SMSVerificator
extends pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
implements SMSExchange
Ordinary sms credential verificator.
Additionally configuration of the credential may allow for lost phone recovery feature. Then are stored email verification settings and confirmation code length.
- Author:
- P.Piernik
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialVerificator
pl.edu.icm.unity.engine.api.authn.CredentialVerificator.VerificatorType -
Field Summary
FieldsFields inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
credentialNameFields inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
identityResolver, instanceNameFields inherited from interface pl.edu.icm.unity.stdext.credential.sms.SMSExchange
ID -
Constructor Summary
ConstructorsConstructorDescriptionSMSVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, pl.edu.icm.unity.stdext.credential.sms.AuthnSMSCounter smslimitCache) -
Method Summary
Modifier and TypeMethodDescriptionpl.edu.icm.unity.base.authn.CredentialPublicInformationcheckCredentialState(String currentCredential) pl.edu.icm.unity.base.authn.AuthenticationMethodinvalidate(String currentCredential) booleanisAuthSMSLimitExceeded(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject username) Check if sms authn sending limit is exceededbooleanisCredentialDefinitionChagneOutdatingCredentials(String newCredentialDefinition) booleanisCredentialSet(pl.edu.icm.unity.base.entity.EntityParam entity) prepareCredential(String rawCredential, String currentCredential, boolean verifyNew) pl.edu.icm.unity.engine.api.confirmation.SMSCodesendCode(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, boolean force) Send code to the uservoidpl.edu.icm.unity.engine.api.authn.AuthenticationResultverifyCode(pl.edu.icm.unity.engine.api.confirmation.SMSCode sentCode, String codeFromUser, pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject) Verifies the user provided sms code.Methods inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
getCredentialName, getType, isSupportingInvalidation, setCredentialName, updateCredentialAfterConfigurationChangeMethods inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
getDescription, getExchangeId, getName, setIdentityResolver, setInstanceNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialExchange
getExchangeIdMethods inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialVerificator
setIdentityResolver, setInstanceNameMethods inherited from interface pl.edu.icm.unity.base.describedObject.DescribedObject
getDescriptionMethods inherited from interface pl.edu.icm.unity.base.describedObject.NamedObject
getName
-
Field Details
-
NAME
- See Also:
-
DESC
- See Also:
-
IDENTITY_TYPES
-
-
Constructor Details
-
SMSVerificator
@Autowired public SMSVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, pl.edu.icm.unity.stdext.credential.sms.AuthnSMSCounter smslimitCache)
-
-
Method Details
-
prepareCredential
public String prepareCredential(String rawCredential, String currentCredential, boolean verifyNew) throws pl.edu.icm.unity.engine.api.authn.IllegalCredentialException, pl.edu.icm.unity.base.exceptions.InternalException - Specified by:
prepareCredentialin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.engine.api.authn.IllegalCredentialExceptionpl.edu.icm.unity.base.exceptions.InternalException
-
checkCredentialState
public pl.edu.icm.unity.base.authn.CredentialPublicInformation checkCredentialState(String currentCredential) throws pl.edu.icm.unity.base.exceptions.InternalException - Specified by:
checkCredentialStatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.base.exceptions.InternalException
-
invalidate
- Specified by:
invalidatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
getSerializedConfiguration
public String getSerializedConfiguration() throws pl.edu.icm.unity.base.exceptions.InternalException- Specified by:
getSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.base.exceptions.InternalException
-
setSerializedConfiguration
public void setSerializedConfiguration(String json) throws pl.edu.icm.unity.base.exceptions.InternalException - Specified by:
setSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.base.exceptions.InternalException
-
sendCode
public pl.edu.icm.unity.engine.api.confirmation.SMSCode sendCode(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject, boolean force) throws pl.edu.icm.unity.base.exceptions.EngineException Description copied from interface:SMSExchangeSend code to the user- Specified by:
sendCodein interfaceSMSExchange- Parameters:
force- forcing auth sms limit omitting- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
verifyCode
public pl.edu.icm.unity.engine.api.authn.AuthenticationResult verifyCode(pl.edu.icm.unity.engine.api.confirmation.SMSCode sentCode, String codeFromUser, pl.edu.icm.unity.engine.api.authn.AuthenticationSubject subject) Description copied from interface:SMSExchangeVerifies the user provided sms code.- Specified by:
verifyCodein interfaceSMSExchange
-
getSMSCredentialResetBackend
- Specified by:
getSMSCredentialResetBackendin interfaceSMSExchange- Returns:
- credential reset backend
-
isAuthSMSLimitExceeded
public boolean isAuthSMSLimitExceeded(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject username) Description copied from interface:SMSExchangeCheck if sms authn sending limit is exceeded- Specified by:
isAuthSMSLimitExceededin interfaceSMSExchange
-
isCredentialSet
public boolean isCredentialSet(pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.exceptions.EngineException - Specified by:
isCredentialSetin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.base.exceptions.EngineException
-
isCredentialDefinitionChagneOutdatingCredentials
- Specified by:
isCredentialDefinitionChagneOutdatingCredentialsin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
getAuthenticationMethod
public pl.edu.icm.unity.base.authn.AuthenticationMethod getAuthenticationMethod()- Specified by:
getAuthenticationMethodin interfacepl.edu.icm.unity.engine.api.authn.CredentialVerificator
-