Class ClientAuthInterceptorFactory
ClientAuthInterceptor.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IClientInterceptorcreate(ClientAuthParams theClientAuthParams) Creates an instance ofIClientInterceptorinitialized with the given client authentication state.static IClientInterceptorcreate(ClientAuthParams theClientAuthParams, OpenIdWellKnownOpenIdConfigurationResponseJson theResolvedWellKnownConfig) Creates an instance ofIClientInterceptorinitialized with the given client authentication state and, optionally, an already resolved well-known configuration.static voidsetClientAuthSelector(IClientAuthSelector theClientAuthSelector)
-
Constructor Details
-
ClientAuthInterceptorFactory
public ClientAuthInterceptorFactory()
-
-
Method Details
-
create
Creates an instance ofIClientInterceptorinitialized with the given client authentication state.The returned interceptor discovers the token endpoint by fetching the
.well-knownconfiguration of the authorization server derived fromClientAuthParams.getBaseUrl()(or, when no base url is configured, from the first intercepted request). Callers which have already resolved that configuration should usecreate(ClientAuthParams, OpenIdWellKnownOpenIdConfigurationResponseJson)instead.- Parameters:
theClientAuthParams- TheClientAuthParamsobject containing the parameters to be used for configuring the interceptor.- Returns:
- An instance of
IClientInterceptorconfigured from the provided parameters.
-
create
public static IClientInterceptor create(ClientAuthParams theClientAuthParams, @Nullable OpenIdWellKnownOpenIdConfigurationResponseJson theResolvedWellKnownConfig) Creates an instance ofIClientInterceptorinitialized with the given client authentication state and, optionally, an already resolved well-known configuration.When
theResolvedWellKnownConfigis non-null it is pre-seeded into the interceptor state, which suppresses.well-knowndiscovery entirely: the token endpoint it carries is used as-is for the token request, and for theaudclaim of the private_key_jwt flow. When it is null the behaviour is identical tocreate(ClientAuthParams), meaning discovery is performed against the authorization server derived fromClientAuthParams.getBaseUrl().A fresh
ClientAuthStateis built on every call, so each returned interceptor caches its access token independently.- Parameters:
theClientAuthParams- TheClientAuthParamsobject containing the parameters to be used for configuring the interceptor.theResolvedWellKnownConfig- The already resolved well-known configuration to use, ornullto let the interceptor discover it.- Returns:
- An instance of
IClientInterceptorconfigured from the provided parameters.
-
setClientAuthSelector
-