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

OIDC Extension - resolve method of TenantConfigResolver is getting invoked *twice* for every request #13040

Closed
missourian55 opened this issue Nov 1, 2020 · 1 comment · Fixed by #13121
Labels
area/oidc kind/bug Something isn't working
Milestone

Comments

@missourian55
Copy link

Describe the bug
Testing the Programmatically Resolving Tenants Configuration as per this guide, noticed that the resolve method is invoked twice for every request

https://quarkus.io/guides/security-openid-connect-multitenancy#programmatically-resolving-tenants-configuration

2020-10-31 18:50:14,415 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2020-10-31 18:50:14,415 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [amazon-s3, cache, cdi, kubernetes, kubernetes-client, micrometer, mutiny, oidc, rest-client, resteasy, resteasy-jsonb, resteasy-mutiny, security, smallrye-context-propagation, smallrye-health]
2020-10-31 18:50:14,415 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-5) Hot replace total time: 3.436s
2020-10-31 18:50:14,417 INFO  [org.acm.s3.CustomTenantConfigResolver] (vert.x-eventloop-thread-7) The path from instance id: org.acme.s3.CustomTenantConfigResolver@435e287 is: /s3-proxy/s3.html
2020-10-31 18:50:14,417 INFO  [org.acm.s3.CustomTenantConfigResolver] (vert.x-eventloop-thread-7) The path from instance id: org.acme.s3.CustomTenantConfigResolver@435e287 is: /s3-proxy/s3.html

Expected behavior
Don't know the root cause, but double invocation of resolve method seems to be a bug

Actual behavior
resolve method should be called once for a given request

To Reproduce

  1. Create a OIDC example as per this https://quarkus.io/guides/security-openid-connect-multitenancy
  2. Create a custom OIDC resolver like below
@JBossLog
public class CustomTenantConfigResolver implements TenantConfigResolver {

    @Override
    public OidcTenantConfig resolve(final RoutingContext context) {
        
        final String path = context.request().path();
        log.infov("The path from instance id: {0} is: {1}", this, path);
        //default config
        return null;

       
    }
}

```log
2020-10-31 18:50:14,417 INFO  [org.acm.s3.CustomTenantConfigResolver] (vert.x-eventloop-thread-7) The path from instance id: org.acme.s3.CustomTenantConfigResolver@435e287 is: /s3-proxy/s3.html
2020-10-31 18:50:14,417 INFO  [org.acm.s3.CustomTenantConfigResolver] (vert.x-eventloop-thread-7) The path from instance id: org.acme.s3.CustomTenantConfigResolver@435e287 is: /s3-proxy/s3.html

Configuration

quarkus.oidc.auth-server-url=http://redacted/auth/realms/quarkus
quarkus.oidc.discovery-enabled=true
quarkus.oidc.client-id=backend
quarkus.oidc.credentials.secret=7redactedb
quarkus.oidc.roles.role-claim-path=scope
# root path
quarkus.http.root-path=/s3-proxy

Environment (please complete the following information):

  • Output of uname -a or ver: Linux x64
  • Output of java -version: Java 11
  • GraalVM version (if different from Java): NA
  • Quarkus version or git rev: 1.9.1.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): mvnw
@missourian55 missourian55 added the kind/bug Something isn't working label Nov 1, 2020
@sberyozkin
Copy link
Member

@missourian55 It is only the case with the default (null) response, but it will be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oidc kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants