Interface AuthenticationMapper
public interface AuthenticationMapper
This interface should be implemented when a custom bean authentication provider is implemented and used in External
Flows. The authentication mapper is dedicated to a single authentication type e.q. 'custom-bean', it can support
multiple
This interface should be able to transfer an
To test the implementation of the
Authentication implementations and ContractVersions. A list of supported contract versions
can be found here: SupportedContractVersions. This interface should be able to transfer an
Authentication object between the External Flow Target and Host.
To test the implementation of the
AuthenticationMapper a round trip test is adviced. First fill call the
fillModel(ObjectModelCreation, Authentication) with a new
ObjectModel and the custom Authentication implementation.
This should fill the ObjectModel with the provided properties to
reconstruct the Authentication implementation in the
toAuthentication(ObjectModelRetrieval). Afterwards the two Authentication
objects can be compared.-
Method Summary
Modifier and TypeMethodDescriptionThe supported authentication type for the custom authentication implementation e.q.booleancanMap(org.springframework.security.core.Authentication authentication) A function that determines if theAuthenticationimplementation is supported by thisAuthenticationMapper.voidfillModel(ObjectModelCreation objectModel, org.springframework.security.core.Authentication authentication) This function is used fill theObjectModelCreationwith the required properties of theAuthenticationobject.booleansupportsContract(ContractVersion contractVersion) A function that determines if theAuthenticationMapperknow how to map the customAuthenticationobject for the providedContractVersion.org.springframework.security.core.AuthenticationtoAuthentication(ObjectModelRetrieval objectModel) This function uses data that is provided from thefillModel(ObjectModelCreation, Authentication)function to recreate theAuthenticationobject.
-
Method Details
-
authenticationType
String authenticationType()The supported authentication type for the custom authentication implementation e.q. 'custom-bean'. The authenticationType is used to identify theAuthenticationMapper.- Returns:
- a custom authenticationType
-
supportsContract
A function that determines if theAuthenticationMapperknow how to map the customAuthenticationobject for the providedContractVersion. This applies for bothfillModel(ObjectModelCreation, Authentication)andtoAuthentication(ObjectModelRetrieval)- Parameters:
contractVersion- the contract version which theAuthenticationMappershould be able to map.- Returns:
- true if the contract version is supported otherwise false.
-
canMap
boolean canMap(org.springframework.security.core.Authentication authentication) A function that determines if theAuthenticationimplementation is supported by thisAuthenticationMapper.- Parameters:
authentication- The to be mappedAuthenticationobject.- Returns:
- true if the
Authenticationobject can be mapped otherwise false.
-
fillModel
void fillModel(ObjectModelCreation objectModel, org.springframework.security.core.Authentication authentication) This function is used fill theObjectModelCreationwith the required properties of theAuthenticationobject. The objectModel should contain enough information for thetoAuthentication(ObjectModelRetrieval)to recreate theAuthentication.- Parameters:
objectModel- the object model to be filled with theAuthenticationproperties.authentication- the authentication object
-
toAuthentication
This function uses data that is provided from thefillModel(ObjectModelCreation, Authentication)function to recreate theAuthenticationobject.- Parameters:
objectModel- the object model where the information to provide aAuthenticationis retrieved from.- Returns:
- the reconstructed
Authenticationobject.
-