-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Issue 10343: Disabled default quarkus-oidc tenant blocks access to th… #10422
Conversation
This commit is linked to this issue: #10343 |
I can enable/disable the security in public endpoints now using this configuration:
Source code to reproduce in here. |
@Sgitario Thanks for this PR, the build fails with the Mockito failure, have a look please. |
Hi Stuart @stuartwdouglas What is not clear to me is why the proactive authentication has to be disabled. Proactive authentication is about verifying the token even if the resource is public. But @Sgitario explains that no token is available, therefore, given that the current request path is public, OIDC (or other active) authentication mechanism must not be invoked at all ? |
5a58161
to
a4c907c
Compare
Fixed by adding the vertx-codegen dependency in the tests (this is the root cause of this issue which only affects to Java 8) |
FYI, I had to disable the proactive authentication in order to avoid that the authentication was invoked in this line. |
@Sgitario We have a public resource test but I think it works because at the |
Not sure what you meant, I could not see any .invocation to deferred() in either CodeAuthenticationMechanism or BearerAuthenticationmechanism. |
@Sgitario Sorry, my bad, it is done here: |
So, if I understand it correctly, the OidcAuthenticationMechanism checks which mechanism to use (either Code or Bearer). And then, each of these mechanism delegate to the identity provider. |
Hi @Sgitario Your PR is the step in the right direction :-), it just raises the question if the (earlier) decision to return a null context if the tenant is disabled is correct. I'll need to check, I'm a bit overwhelmed right now, but we are on it with your help now :-) |
In the proactive case io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism#authenticate should be called, but not io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism#getChallenge. If this is taking over the request then this is a bug, the authenticate() method should just return an empty identity if there is no token. |
…e public resources
The objective is to allow to configure the security of endpoints in runtime. The problem is that at the moment, it's checking the tenant configuration always, regardless these properperties:
The issue happens when I configured the endpoints to public access and I didn't configure the tenant configuration. If the proactive is disabled, I think the expected behaviour should be that no tenant configuration is checked and I got access to my public endpoint. What is happening is that it's failing because No Tenant Configuration is provided. |
@Sgitario Hi, sorry for a delay, I've opened another PR: |
Many thanks @sberyozkin ! I did check these changes and now it's possible to enable/disable the authentication at runtime:
|
No description provided.