AuthenticationConverter
Defines an SPI to attempt to convert a Spring Authentication into an Apache Causeway UserMemento .
The Authentication will have already been verified as having been Authentication#isAuthenticated() authenticated .
Implementations should be defined as Spring Component s and added to the Configuration application context either by being Import imported explicitly or implicitly through ComponentScan .
All known converters are checked one by one, but checking stops once one converter has successively converted the Authentication into a UserMemento (in other words, chain-of-responsibility pattern). Use the jakarta.annotation.Priority annotation to influence the order in which converter implementations are checked.
API
interface AuthenticationConverter {
UserMemento convert(Authentication authentication) (1)
}
1 | convert(Authentication)
Attempt to convert a Spring Authentication (which will have been Authentication#isAuthenticated() authenticated ) into a UserMemento . |
Members
convert(Authentication)
Attempt to convert a Spring Authentication (which will have been Authentication#isAuthenticated() authenticated ) into a UserMemento .
There are many different implementations of Authentication , so the implementation should be targeted at a specific implementation.
The framework provides some default implementations for the most common use cases.