public interface TokenProvider
Authorization header to requests| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<String> |
getToken(ConnectionContext connectionContext)
Provides an OAuth token to be used by requests
|
default void |
invalidate(ConnectionContext connectionContext)
Called when a
401 UNAUTHORIZED is received as part of a request. |
reactor.core.publisher.Mono<String> getToken(ConnectionContext connectionContext)
connectionContext - A ConnectionContext to be used if a token needs to be retrieved via a network requestdefault void invalidate(ConnectionContext connectionContext)
401 UNAUTHORIZED is received as part of a request. Since not all TokenProviders care about this possibility, the default implementation does nothing.
Implementations are free to manage internal state with this call if they choose to.connectionContext - A ConnectionContext to be used to identity which connection the tokens should be invalidated forCopyright © 2019. All rights reserved.