Description
Need to add support for retrieving tokens from different headers in one component. This is a common case when a project has multiple authentication schemes. For example, in ProviderManager there are two providers, but one gets the token through DefaultBearerTokenResolver and the other from a non-standard header like -X-Authorization.
For example, component DelegatingBearerTokenResolver:
@Override
public String resolve(HttpServletRequest request) {
return delegates.stream()
.map(d -> d.resolve(request))
.filter(Objects::nonNull)
.findAny()
.orElse(null);
}