-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 Oauth2 quarkus.oauth2.enabled doesn't seem to work #10427
Comments
Hi, can I try to fix this? |
@manodupont Are you sure you are using it properly? |
Le's see first if this is just a misuse issue |
If the method is role protected then the RBAC layer just wants to enforce it, it does not know how |
@sberyozkin I understand your point. However, it's confusing at first sight to learn what's the expected behavior when disabling the oauth2 extension and have multiple methods as role protected. At least, it should be documentation that explains in detail how Quarkus behaves in this case. |
Ok. But im more confused after all that :) So what is setting it to false actually doing ? Sorry for my misunderstanding! |
I assume that disables oauth2 support only, not whole RBAC layer from protecting all methods. |
Oh right. I Didn’t test that... it might be right. Ok well i guess its a no bug then. Thanks! |
Feel free to close the issue if you believe it's resolved
…On Thu, Jul 2, 2020, 21:06 Manuel Dupont ***@***.***> wrote:
Oh right. I Didn’t test that... it might be right.
Ok well i guess its a no bug then. Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP3YPTLBLRHJWGX6RGTRZTEBVANCNFSM4OOY4YZA>
.
|
Right this or any other extension dealing with the authentication is only populating a I wonder though if the time has come to introduce a property like a default role (someone has suggested it already). Or have a property like |
Late to the party but yes, This is a build time property as the classical use case is to use an embedded security provider in dev/test and the OAuth2 in production. As dev/test re-play build steps you it works. I don't think there is currently a way to disabled Quarkus security fully, at least it's not documented inside the Security Guide (https://quarkus.io/guides/security). If it's a legitimate use case (but it can also create a security threat to enable bypassing the security layer) maybe we should add it. When we design the OAuth2 extension we don't offer a way to disable the security layer because we think people will use an embedded provider in dev/test (via the |
I have implemented something here: #10487 |
Hi @stuartwdouglas That looks good, but I'm not sure it is related to this one, here the user would like to disable some authentication module and the authorization check at runtime |
I thought the use case here was to disable security in testing? |
@manodupont, Hi, can you confirm please ? |
No i meant at runtime too. I thought it was a single flag to turn every security and roles checking “off”. |
So you can do it at runtime as well, but it requires some custom code:
Including this bean in your application will disable security. If you want to make it configurable just make it inject a configuration property using MP config. I am a bit hesitant about including this as a general config option, it just feels a bit dangerous. |
ok. thanks everybody. |
It would be great to have this documented somewhere. |
I'd say so, I believe we've had a good number of similar queries, not sure where, may be at https://quarkus.io/guides/security to start with, have a section |
Of course! :) |
@ejba Hi, I was planning to add this example to the open PR (to do with repurposing |
Is this one? |
Line 9 in fa6cede
|
@ejba @stuartwdouglas thanks :-), not sure why I'm not seeing it, may be because I have Eclipse workspace bugs. OK, So I'll push the update the proposed |
After doing this, I receive the below error. The only change I did was to annotate a test with @testsecurity(authorizationEnabled = false) and created a DisabledAuthContoller. When I do mvn clean compile install, I receive the above error that I am inject a bean which is ambiguous |
Describe the bug
Setting this
quarkus.oauth2.enabled=false
doesnt "disable" the oauth2 features. I need to comment out my annotations about "@RolesAllowed" to disable oauth verification.Expected behavior
Setting this
quarkus.oauth2.enabled=false
only, would make all security "checks" disabled so i don't need to comment out any other code lines.Actual behavior
Setting this
quarkus.oauth2.enabled=false
doesnt "disable" the oauth2 features. I need to comment out my annotations about "@RolesAllowed" to disable oauth verification.To Reproduce
Steps to reproduce the behavior:
quarkus.oauth2.enabled=false
Environment (please complete the following information):
uname -a
orver
:java -version
: 11mvnw --version
orgradlew --version
): 3.6.3The text was updated successfully, but these errors were encountered: