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.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,pl.edu.icm.unity.types.DescribedObject,pl.edu.icm.unity.types.NamedObject
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:
SMSCredential
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSMSVerificator.Factory
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDESCstatic java.lang.String[]IDENTITY_TYPESstatic java.lang.StringNAME-
Fields inherited from class pl.edu.icm.unity.engine.api.authn.local.AbstractLocalVerificator
credentialName
-
Fields inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
identityResolver, instanceName
-
Fields inherited from interface pl.edu.icm.unity.stdext.credential.sms.SMSExchange
ID
-
-
Constructor Summary
Constructors Constructor Description SMSVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, AuthnSMSCounter smslimitCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description pl.edu.icm.unity.types.authn.CredentialPublicInformationcheckCredentialState(java.lang.String currentCredential)java.lang.StringgetSerializedConfiguration()SMSCredentialResetImplgetSMSCredentialResetBackend()java.lang.Stringinvalidate(java.lang.String currentCredential)booleanisAuthSMSLimitExceeded(pl.edu.icm.unity.engine.api.authn.AuthenticationSubject username)Check if sms authn sending limit is exceededbooleanisCredentialDefinitionChagneOutdatingCredentials(java.lang.String newCredentialDefinition)booleanisCredentialSet(pl.edu.icm.unity.types.basic.EntityParam entity)java.lang.StringprepareCredential(java.lang.String rawCredential, java.lang.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 uservoidsetSerializedConfiguration(java.lang.String json)pl.edu.icm.unity.engine.api.authn.AuthenticationResultverifyCode(pl.edu.icm.unity.engine.api.confirmation.SMSCode sentCode, java.lang.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, updateCredentialAfterConfigurationChange
-
Methods inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
getDescription, getExchangeId, getName, setIdentityResolver, setInstanceName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
DESC
public static final java.lang.String DESC
- See Also:
- Constant Field Values
-
IDENTITY_TYPES
public static final java.lang.String[] IDENTITY_TYPES
-
-
Constructor Detail
-
SMSVerificator
@Autowired public SMSVerificator(pl.edu.icm.unity.engine.api.notification.NotificationProducer notificationProducer, pl.edu.icm.unity.engine.api.authn.local.CredentialHelper credentialHelper, AuthnSMSCounter smslimitCache)
-
-
Method Detail
-
prepareCredential
public java.lang.String prepareCredential(java.lang.String rawCredential, java.lang.String currentCredential, boolean verifyNew) throws pl.edu.icm.unity.exceptions.IllegalCredentialException, pl.edu.icm.unity.exceptions.InternalException- Specified by:
prepareCredentialin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.IllegalCredentialExceptionpl.edu.icm.unity.exceptions.InternalException
-
checkCredentialState
public pl.edu.icm.unity.types.authn.CredentialPublicInformation checkCredentialState(java.lang.String currentCredential) throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
checkCredentialStatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
invalidate
public java.lang.String invalidate(java.lang.String currentCredential)
- Specified by:
invalidatein interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
getSerializedConfiguration
public java.lang.String getSerializedConfiguration() throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
getSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.exceptions.InternalException
-
setSerializedConfiguration
public void setSerializedConfiguration(java.lang.String json) throws pl.edu.icm.unity.exceptions.InternalException- Specified by:
setSerializedConfigurationin interfacepl.edu.icm.unity.engine.api.utils.StringConfigurable- Throws:
pl.edu.icm.unity.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.exceptions.EngineExceptionDescription copied from interface:SMSExchangeSend code to the user- Specified by:
sendCodein interfaceSMSExchangeforce- forcing auth sms limit omitting- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
verifyCode
public pl.edu.icm.unity.engine.api.authn.AuthenticationResult verifyCode(pl.edu.icm.unity.engine.api.confirmation.SMSCode sentCode, java.lang.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
public SMSCredentialResetImpl 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.types.basic.EntityParam entity) throws pl.edu.icm.unity.exceptions.EngineException- Specified by:
isCredentialSetin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
isCredentialDefinitionChagneOutdatingCredentials
public boolean isCredentialDefinitionChagneOutdatingCredentials(java.lang.String newCredentialDefinition)
- Specified by:
isCredentialDefinitionChagneOutdatingCredentialsin interfacepl.edu.icm.unity.engine.api.authn.local.LocalCredentialVerificator
-
-