-
Notifications
You must be signed in to change notification settings - Fork 6k
java.lang.IllegalStateException: Only one connection receive subscriber allowed. #6071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem seems that Spring Security is not handling a redirect properly. The redirect is happening when the request for a token is being submitted to http://dev.hold.co/as/oauth/token It then redirects to https. To fix it change your configuration to use https I will investigate how to get a proper error message to the user. In the meantime, hopefully this helps you make some progress. |
The reason for the strange error message is SPR-17482. If you update to Spring Framework 5.1.3.BUILD-SNAPSHOT the error is now a 401.
This makes sense since the token was unable to be gotten. We should obviously improve our error message, but at least now all the pieces make sense. |
The error completely threw me off.. You're right, changing to https seems to work. However, when dealing with additional information in the token response (<String, Object>) jackson throws an exception. Looking at OAuth2AccessTokenResponseBody class to extract the OAuth2AccessTokenResponse: @Override
public Mono<OAuth2AccessTokenResponse> extract(ReactiveHttpInputMessage inputMessage,
Context context) {
ParameterizedTypeReference<Map<String, String>> type = new ParameterizedTypeReference<Map<String, String>>() {};
BodyExtractor<Mono<Map<String, String>>, ReactiveHttpInputMessage> delegate = BodyExtractors.toMono(type);
return delegate.extract(inputMessage, context)
.map(json -> parse(json))
.flatMap(OAuth2AccessTokenResponseBodyExtractor::oauth2AccessTokenResponse)
.map(OAuth2AccessTokenResponseBodyExtractor::oauth2AccessTokenResponse);
} Looks like you're forcing Map<String, String> and down the road on parse (line 66) new JSONObject() can deal with Map<String, ?>. Here's the error thrown:
Here's the token response:
Should I create a new ticket? |
@hfgbarrigas Yes please do create a new ticket with these details. Thanks! |
Here: 6087 Thank you. |
Thanks. I'm closing this in favor of the two Spring Security issues we created and the fixed Spring Framework JIRA |
Summary
Trying oauth2 client_credentials integration with webclient but getting the IllegalStateException.
Configuration
Using a custom provider. Here's the configuration:
My web security is as follows:
Configuring webclient as follows:
Webclient usage:
Logs:
Version
Spring version: 5.1.1.RELEASE
Reactor Netty version: 0.8.2.RELEASE
Reactor Core version: 3.2.2.RELEASE
Sample
https://github.com/hfgbarrigas/oauth2client-webflux-error-sample
The text was updated successfully, but these errors were encountered: