Describe the bug ServerBearerTokenAuthenticationConverter throws exceptions in case bearer token doesn't match pattern or authorization header and access token query param are both present in request.
To Reproduce Send invalid bearer token in authorization header. For example, you can add test bellow to ServerBearerTokenAuthenticationConverterTests.
@Test
public void simpleTest() {
MockServerHttpRequest.BaseBuilder<?> request = MockServerHttpRequest
.get("/")
.header(HttpHeaders.AUTHORIZATION, "bearer !!");
assertThatCode(() -> this.converter.convert(MockServerWebExchange.from(request))).doesNotThrowAnyException();
}
Expected behavior ServerBearerTokenAuthenticationConverter should signal error after subscribing to returned publisher not to throw error after calling convert method.
I'm able to submit a PR.
Comment From: rwinch
Thank you for reporting this and volunteering to submit a PR @qavid! We'd love to see a pull request for this issue.
Comment From: qavid
Hi @rwinch , I'll work on it next week/weekend after my vacation.