-
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
Add support for well-known OIDC providers #22572
Conversation
9eb0a29
to
8f7eaaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but note that some config lost their default values, so they're not documented anymore. IMO you should add them as documentation if they still have default values, no?
@FroMage Good point, I'll update JavaDocs today. (I'll be off till next Wed) |
8f7eaaf
to
1166213
Compare
Hi @FroMage and @pedroigor, thanks, I've updated JavaDocs. By the way, by default, both I'd also like to wait until @stuartwdouglas returns from PTO in case he'd like to add something since he created the original PR Happy New Year :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of small suggestions.
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcTenantConfig.java
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
...sions/oidc-common/runtime/src/main/java/io/quarkus/oidc/common/runtime/OidcCommonConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
@sberyozkin could you have a look at my comments? This is a very nice addition for 2.7 and it would be cool to get it in. |
@sberyozkin friendly ping. CR1 is next week and if we want this in, we need it merged. |
Hi @gsmet sorry for a delay, only returned this morning, let me deal with the comments, thanks, I just wanted to wait for Stuart to have a quick look as this PR replaces the one he started with. I'll merge on Monday evening/Tue morning if no comments will follow, 19th is Wed, so it should make it just in time |
1166213
to
f1122ee
Compare
Hi @gsmet, I believe I've addressed the comments, and might add something for Facebook
, please request more changes if needed
I'm about to test this. |
@sberyozkin I've tested this, and it almost works. I've added missing providers, and changed some scopes and turned them into lists. My only issue is with the microsoft provider, it appears that this is not picked up:
Because I'm getting a 401 in my tests, due to Quarkus checking the issuer. At least I'm sure it's that, because you don't log any auth failures so it would take me a lot of debugging to figure it out (we really have to fix this). I'm sure it's that because if I re-enable:
Then my test passes. |
@FroMage Thanks, Let me update I'm a bit confused about Re |
@FroMage never mind, it is all can be easily overridden, lets keep it in the form which works best OOB for the application which drives these enhancements :-) |
8548d2b
to
b3e1c61
Compare
@FroMage I added the tests and |
I did set it up in Azure, is all I know. I could not find
My opinion is the opposite: most websites won't need a user name, they will ALL require a user ID though, but OIDC gives that OOTB. Most of them will require an email though, to be able to communicate with the user, and getting it from OIDC allows them to skip validating the email. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that works, thanks, much better!
@stuartwdouglas could you have a look at that one? I will like to get it merged for 2.7.0.CR1 which will be released on Wednesday morning Paris time so we need to iterate quickly on it. |
I'm planning to merge tomorrow morning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Damnit, I'm actually missing a few properties. |
@sberyozkin those are not merged: ret.getAuthentication().setExtraParams(new HashMap<>());
ret.getAuthentication().getExtraParams().put("response_mode", "form_post");
ret.getAuthentication().setForceRedirectHttpsScheme(true); |
@FroMage please set |
Ah. #22029 OK.
Yes and no. No, because Apple will just never work without https so we might as well make those links as it wants them. But that's also related to |
@FroMage Sure, lets add |
OK, done at #23061 |
Replaces #22176, Fixes #20783.
This PR builds on Stuart's idea but instead uses
OidcTenantConfig
references to well-known providers from the currentOidcTenantConfig
. Any of the statically or dynamically configured ODC tenants can refer to them and override as many properties as needed and add as many properties as needed in scope of the current tenant.It will allow the following variations:
TenantConfigResolver
:This PR supports
GitHub
andApple
only in the beginning. Not sure about Microsoft - I believe some of its providers also have tenant specificauthServerUrl
. I think it makes sense to add them one by one - if we see all users dealing with a given provider have to set at least 2 identical properties includingauthServerIUrl
then it would qualify.PR is based on the idea of merging the current
OidcTenantConfig
with the referenced provider'sOidcTenantConfig
. At the moment the copying of properties is done selectively to handle the supported providers (GitHub for now) - it is safe as this merge operation can only happen if a recognized enum provider value is configured. I had to remove some default values for some properties and handle defaults directly in the code as otherwise it is not clear if it was the user who set this property or it was defaulted to some value.Going forward it would be good to let the users provide arbitrary
OidcTenantConfig
blocks, example,myKeycloakWithHttpsAndProxyEtc
which can be referenced asquarlus.oidc.provider
.I've updated the current
GitHub
andApple
OIDC web-app doc fragments, but we'll have a proper doc dedicated to configuring various providers once we have a few more issues reported by Steph addressed...CC @FroMage