Class Ltpa2AuthConverter
java.lang.Object
de.sephirothj.spring.security.ltpa2.reactive.Ltpa2AuthConverter
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.security.web.server.authentication.ServerAuthenticationConverter
public class Ltpa2AuthConverter
extends Object
implements org.springframework.security.web.server.authentication.ServerAuthenticationConverter, org.springframework.beans.factory.InitializingBean
Strategy for converting a
ServerWebExchange to an Authentication based on LTPA2 tokens. The final authentication will be done by a Ltpa2AuthManager. The token is expected to be given in the header headerName with an optional prefix. If the header is empty or not found the token will be searched in the cookie named cookieName.- Author:
- Sephiroth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreactor.core.publisher.Mono<org.springframework.security.core.Authentication> convert(org.springframework.web.server.ServerWebExchange exchange) Extracts an LTAP2 token from the definedheaderorcookie(as fallback), validates it and if it is, creates anAuthenticationinstance with it
-
Constructor Details
-
Ltpa2AuthConverter
public Ltpa2AuthConverter()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
convert
public reactor.core.publisher.Mono<org.springframework.security.core.Authentication> convert(org.springframework.web.server.ServerWebExchange exchange) Extracts an LTAP2 token from the definedheaderorcookie(as fallback), validates it and if it is, creates anAuthenticationinstance with it- Specified by:
convertin interfaceorg.springframework.security.web.server.authentication.ServerAuthenticationConverter- Parameters:
exchange- TheServerWebExchange- Returns:
- A
Monorepresenting anAuthenticationwith a validLtpa2Tokenas credentials or an empty Mono if the token was not found or is invalid
-