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

@OpenIdAuthenticationMechanismDefinition annotation is not repeatable in 4.0 #342

Open
fschoning opened this issue Nov 4, 2024 · 0 comments

Comments

@fschoning
Copy link

I am trying to use two different OIDC authentication provider clients within the same Wildfly 34 Preview JakartaEE 11 web application. As far as I understand, in Jakarta EE 3.0 this is not possible but has been made possible in 4.0 by using Qualifiers.

I have created two servlets, each with the @OpenIdAuthenticationMechanismDefinitionannotation and each with their own Qualifier annotation. However on deployment I still get the error: "Ambiguous dependencies for type OpenIdAuthenticationMechanismDefinition with qualifiers @default"

My code is as follows:

@Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) public @interface QualifierA { }

@Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) public @interface QualifierB { }

@QualifierA @OpenIdAuthenticationMechanismDefinition( providerURI = "${oidcConfigA.issuerUri}", clientId = "${oidcConfigA.clientId}", clientSecret = "${oidcConfigA.clientSecret}", redirectURI = "${baseURL}/oidcredirecturi", jwksReadTimeout = 5000, jwksConnectTimeout = 5000) @ServletSecurity(@HttpConstraint(rolesAllowed = "Everyone")) @WebServlet("/alogin") public class OidcLoginWebServletA extends HttpServlet {

@QualifierB @OpenIdAuthenticationMechanismDefinition( providerURI = "${oidcConfigB.issuerUri}", clientId = "${oidcConfigB.clientId}", clientSecret = "${oidcConfigB.clientSecret}", redirectURI = "${baseURL}/oidcredirecturi", jwksReadTimeout = 5000, jwksConnectTimeout = 5000) @ServletSecurity(@HttpConstraint(rolesAllowed = "Everyone")) @WebServlet("/blogin") public class OidcLoginWebServletB extends HttpServlet {

I do not know if I am using the feature wrong or if this is an issue? I cannot see an example of this in the tck tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant