Class WebClientAccessTokenRetriever
- java.lang.Object
-
- org.bremersee.web.reactive.function.client.AbstractWebClientErrorDecoder<org.springframework.security.core.AuthenticationException>
-
- org.bremersee.security.authentication.WebClientAccessTokenRetriever
-
- All Implemented Interfaces:
Function<org.springframework.web.reactive.function.client.ClientResponse,reactor.core.publisher.Mono<? extends Throwable>>,org.bremersee.security.authentication.AccessTokenRetriever<reactor.core.publisher.Mono<String>>,WebClientErrorDecoder<org.springframework.security.core.AuthenticationException>
public class WebClientAccessTokenRetriever extends AbstractWebClientErrorDecoder<org.springframework.security.core.AuthenticationException> implements org.bremersee.security.authentication.AccessTokenRetriever<reactor.core.publisher.Mono<String>>
A reactive implementation of theAccessTokenRetriever.- Author:
- Christian Bremer
-
-
Constructor Summary
Constructors Constructor Description WebClientAccessTokenRetriever()Instantiates a new access token retriever that uses spring's web client.WebClientAccessTokenRetriever(ReactiveAccessTokenCache accessTokenCache)Instantiates a new access token retriever that uses spring's web client.WebClientAccessTokenRetriever(org.springframework.web.reactive.function.client.WebClient webClient)Instantiates a new access token retriever that uses spring's web client.WebClientAccessTokenRetriever(org.springframework.web.reactive.function.client.WebClient webClient, ReactiveAccessTokenCache accessTokenCache)Instantiates a new access token retriever that uses spring's web client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.AuthenticationExceptionbuildException(org.springframework.web.reactive.function.client.ClientResponse clientResponse, String response)Build exception.reactor.core.publisher.Mono<String>retrieveAccessToken(org.bremersee.security.authentication.AccessTokenRetrieverProperties properties)-
Methods inherited from class org.bremersee.web.reactive.function.client.AbstractWebClientErrorDecoder
apply
-
-
-
-
Constructor Detail
-
WebClientAccessTokenRetriever
public WebClientAccessTokenRetriever()
Instantiates a new access token retriever that uses spring's web client.
-
WebClientAccessTokenRetriever
public WebClientAccessTokenRetriever(ReactiveAccessTokenCache accessTokenCache)
Instantiates a new access token retriever that uses spring's web client.- Parameters:
accessTokenCache- the access token cache
-
WebClientAccessTokenRetriever
public WebClientAccessTokenRetriever(org.springframework.web.reactive.function.client.WebClient webClient)
Instantiates a new access token retriever that uses spring's web client.- Parameters:
webClient- the web client
-
WebClientAccessTokenRetriever
public WebClientAccessTokenRetriever(org.springframework.web.reactive.function.client.WebClient webClient, ReactiveAccessTokenCache accessTokenCache)Instantiates a new access token retriever that uses spring's web client.- Parameters:
webClient- the web clientaccessTokenCache- the access token cache
-
-
Method Detail
-
retrieveAccessToken
public reactor.core.publisher.Mono<String> retrieveAccessToken(org.bremersee.security.authentication.AccessTokenRetrieverProperties properties)
- Specified by:
retrieveAccessTokenin interfaceorg.bremersee.security.authentication.AccessTokenRetriever<reactor.core.publisher.Mono<String>>
-
buildException
public org.springframework.security.core.AuthenticationException buildException(org.springframework.web.reactive.function.client.ClientResponse clientResponse, String response)Description copied from interface:WebClientErrorDecoderBuild exception.- Specified by:
buildExceptionin interfaceWebClientErrorDecoder<org.springframework.security.core.AuthenticationException>- Parameters:
clientResponse- the client responseresponse- the response- Returns:
- the exception
-
-