Skip to content
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

Quarkus main - "Multiple mechanisms present that use the same credential transport HttpCredentialTransport" Error, not in Quarkus 2.1.0.Final #19190

Closed
rsvoboda opened this issue Aug 3, 2021 · 1 comment
Labels
kind/bug Something isn't working triage/invalid This doesn't seem right

Comments

@rsvoboda
Copy link
Member

rsvoboda commented Aug 3, 2021

Describe the bug

Whwn using oidc,quarkus-smallrye-jwt extensions with Quarkus main I receive "Multiple mechanisms present that use the same credential transport HttpCredentialTransport" Error.
This error is not present when using Quarkus 2.1.0.Final.

I can't say for sure if this is intended or not. @sberyozkin fyi.

18:00:44.958 INFO  [app] 18:00:41,714 Unhandled exception in router: java.lang.RuntimeException: Multiple 
 mechanisms present that use the same credential transport 
 HttpCredentialTransport{transportType=AUTHORIZATION, typeTarget='bearer', authenticationScheme='bearer'}. 
 Mechanisms are io.quarkus.smallrye.jwt.runtime.auth.JWTAuthMechanism@215b7829 and 
 io.quarkus.oidc.runtime.OidcAuthenticationMechanism@49d5293

Expected behavior

No error is thrown.

Actual behavior

java.lang.RuntimeException is thrown

How to Reproduce?

rm -rf app-generated-skeleton && mvn io.quarkus:quarkus-maven-plugin:2.1.0.Final:create -DprojectGroupId=my-groupId -DprojectArtifactId=app-generated-skeleton -DprojectVersion=1.0.0-SNAPSHOT -DpackageName=org.my.group -DplatformVersion=2.1.0.Final -DplatformArtifactId=quarkus-bom -Dextensions=resteasy,oidc,quarkus-smallrye-jwt

mvn -f app-generated-skeleton/pom.xml clean quarkus:dev -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.platform.group-id=io.quarkus

// works fine with Quarkus 2.1.0.Final (mvn -f app-generated-skeleton/pom.xml clean quarkus:dev)

curl http://127.0.0.1:8080/hello

Output of uname -a or ver

macOS BigSur

Output of java -version

Java 11

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@rsvoboda rsvoboda added the kind/bug Something isn't working label Aug 3, 2021
@sberyozkin
Copy link
Member

Hi Rostislav, @rsvoboda, sorry, but it is not a bug - it is by design that combining conflicting methods is expected to fail (CC @stuartwdouglas) - the fact it was working in 2.1.0.Final was in fact a regression which I introduced after adding an authenticationScheme property to HTTP credential transport - there was an issue recently where the user forgot to remove smallrye-jwt while working with quarkus-oidc and got some strange side-effects as well

@sberyozkin sberyozkin added triage/invalid This doesn't seem right and removed triage/needs-triage labels Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants