The OAuth2 filter may be absent (if no OAuth conf is active)
@@ -89,7 +89,7 @@ public class OAuthTokenExtractor {
* provided, then there is no OAuth authentication on client side. If provided, then the client uses it to provide
* the OAuth2 authorization token, when accessing the GraphQL resource server, for queries/mutations/subscriptions.
*/
- @Autowired
+ @Autowired(required = false)
ServerOAuth2AuthorizedClientExchangeFilterFunction serverOAuth2AuthorizedClientExchangeFilterFunction;
/** The filter which retrieves the Authorization header value */
@@ -103,6 +103,7 @@ public class OAuthTokenExtractor {
@PostConstruct
void init() {
+ if (serverOAuth2AuthorizedClientExchangeFilterFunction != null) {
oAuthTokenFilter = new OAuthTokenFilter();
// The filter will be applied in their reverse order.
@@ -115,6 +116,7 @@ public class OAuthTokenExtractor {
throw new RuntimeException(e.getMessage(), e);
}
}
+ }
/**
* Returns the Authorization header value, as it has been returned by the
