Class AbstractRemoteVerificator
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.authn.AbstractVerificator
-
- pl.edu.icm.unity.engine.api.authn.remote.AbstractRemoteVerificator
-
- All Implemented Interfaces:
CredentialExchange
,CredentialVerificator
,StringConfigurable
,pl.edu.icm.unity.types.DescribedObject
,pl.edu.icm.unity.types.NamedObject
public abstract class AbstractRemoteVerificator extends AbstractVerificator
Base class that is nearly mandatory for all remote verificators. The remote verificator should extend it by implementing aCredentialExchange
of choice. The implementation should obtain theRemotelyAuthenticatedInput
(the actual coding should be done here) and before returning it should be processed by#getResult(RemotelyAuthenticatedInput)
to obtain the final authentication result.Additionally (to enable compatibility with sandbox authN facility) the extension must call
#startAuthnResponseProcessing(String...)
at the beginning of authN response verification and#finishAuthnResponseProcessing(RemoteAuthnState, AuthenticationException, RemotelyAuthenticatedInput)
in case of any exception produced during verification.- Author:
- K. Benedyczak
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractRemoteVerificator.RemoteAuthnState
Marker interface only.-
Nested classes/interfaces inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialVerificator
CredentialVerificator.VerificatorType
-
-
Field Summary
-
Fields inherited from class pl.edu.icm.unity.engine.api.authn.AbstractVerificator
identityResolver, instanceName
-
-
Constructor Summary
Constructors Constructor Description AbstractRemoteVerificator(java.lang.String name, java.lang.String description, java.lang.String exchangeId, RemoteAuthnResultProcessor processor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finishAuthnResponseProcessing(AbstractRemoteVerificator.RemoteAuthnState state, java.lang.Exception error)
Should be called at the end of failed verification.protected AuthenticationResult
getResult(RemotelyAuthenticatedInput input, pl.edu.icm.unity.types.translation.TranslationProfile profile, AbstractRemoteVerificator.RemoteAuthnState state)
This method is calling#processRemoteInput(RemotelyAuthenticatedInput)
and then#assembleAuthenticationResult(RemotelyAuthenticatedContext)
.static pl.edu.icm.unity.types.translation.TranslationProfile
getTranslationProfile(UnityPropertiesHelper props, java.lang.String globalProfileNameKey, java.lang.String embeddedProfileKey)
protected AbstractRemoteVerificator.RemoteAuthnState
startAuthnResponseProcessing(SandboxAuthnResultCallback callback, java.lang.String... loggingFacilities)
Should be called at the beginning of authN response verification-
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
-
Methods inherited from interface pl.edu.icm.unity.engine.api.authn.CredentialVerificator
getType
-
Methods inherited from interface pl.edu.icm.unity.engine.api.utils.StringConfigurable
getSerializedConfiguration, setSerializedConfiguration
-
-
-
-
Constructor Detail
-
AbstractRemoteVerificator
public AbstractRemoteVerificator(java.lang.String name, java.lang.String description, java.lang.String exchangeId, RemoteAuthnResultProcessor processor)
-
-
Method Detail
-
getResult
protected AuthenticationResult getResult(RemotelyAuthenticatedInput input, pl.edu.icm.unity.types.translation.TranslationProfile profile, AbstractRemoteVerificator.RemoteAuthnState state) throws AuthenticationException
This method is calling#processRemoteInput(RemotelyAuthenticatedInput)
and then#assembleAuthenticationResult(RemotelyAuthenticatedContext)
. Usually it is the only one that is used in subclasses, whenRemotelyAuthenticatedInput
is obtained in an implementation specific way.- Parameters:
input
-- Returns:
- Throws:
pl.edu.icm.unity.exceptions.EngineException
AuthenticationException
-
startAuthnResponseProcessing
protected AbstractRemoteVerificator.RemoteAuthnState startAuthnResponseProcessing(SandboxAuthnResultCallback callback, java.lang.String... loggingFacilities)
Should be called at the beginning of authN response verification- Parameters:
loggingFacilities
- logging facilities relevant for the verification process- Returns:
-
finishAuthnResponseProcessing
protected void finishAuthnResponseProcessing(AbstractRemoteVerificator.RemoteAuthnState state, java.lang.Exception error)
Should be called at the end of failed verification.- Parameters:
state
-error
-remoteInput
- can be null if failure was upon input assembly.
-
getTranslationProfile
public static pl.edu.icm.unity.types.translation.TranslationProfile getTranslationProfile(UnityPropertiesHelper props, java.lang.String globalProfileNameKey, java.lang.String embeddedProfileKey) throws eu.unicore.util.configuration.ConfigurationException
- Throws:
eu.unicore.util.configuration.ConfigurationException
-
-