Support on invalid authentication / org.cloudfoundry.reactor.util.Operator$ResponseReceiver$InvalidTokenException is private
See original GitHub issueThis is in reference to https://github.com/promregator/promregator/issues/182#issuecomment-637757562.
In a nutshell: A user apparently has some sort of authentication issue when trying to logon to the CF platform (when starting the application). On sending the first request (in our case it’s a cloudFoundryClient.info().get(request)
), an exception is raised:
2020-06-02T10:57:01.79-0400 [APP/PROC/WEB/0] OUT Caused by: org.cloudfoundry.reactor.util.Operator$ResponseReceiver$InvalidTokenException: null
2020-06-02T10:57:01.79-0400 [APP/PROC/WEB/0] OUT Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2020-06-02T10:57:01.79-0400 [APP/PROC/WEB/0] OUT Assembly trace from producer [reactor.core.publisher.MonoProcessor] :
2020-06-02T10:57:01.79-0400 [APP/PROC/WEB/0] OUT reactor.core.publisher.Mono.checkpoint(Mono.java:1862)
2020-06-02T10:57:01.79-0400 [APP/PROC/WEB/0] OUT org.cloudfoundry.reactor.tokenprovider.AbstractUaaTokenProvider.token(AbstractUaaTokenProvider.java:255)
In essence this hints to https://github.com/cloudfoundry/cf-java-client/blob/272094ceca9c54b7ccf125adf80d5be044a4f73b/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/util/Operator.java#L233.
Note that this class is also private
- and virtually does not contain any valuable information - in particular no information about what went wrong during authentication.
I also tried to do along something the lines of
Mono<String> tokenMono = this.cloudFoundryClient.getTokenProvider().getToken(this.cloudFoundryClient.getConnectionContext());
tokenMono.doOnError(e -> {
log.error("Error while getting the Auth Token", e);
}).block();
but also here only the same private exception is raised.
All this leads to the questions: How are consumers of the library intended to perform the verification of authentication? What is the expected error handling / the intended support approach on detecting invalid credentials provided?
Thanks for the pointer!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
With https://github.com/promregator/promregator/issues/183 I have bumped the version to 3.24.0. Will go out with our next release version.
BTW: As already expected, bumping did not change anything in the behavior (initial topic of this ticket).
It’s worth saying that we take great care to retain backwards compatibility, so it’s worth updating to the latest version as often as your corporate policies allow.