Use webfinger for OIDC parameter discovery#847
Conversation
b345a3c to
063efde
Compare
|
Did this PR worked for you @kulmann ? Just tried it without success on my side, when both web + iOS are working perfectly. I have tested the webfinger with: Which returns But when the Authelia page appears I can see that groups are not part of the request. Edit: You can see that scopes ( |
063efde to
01406ed
Compare
|
@RichardFevrier thanks for testing the PR!
|
|
Thanks for your work @kaivol I'll test that tomorrow! 🤩 |
|
@RichardFevrier Have you tested this PR? :) |
|
@kaivol FYI CI ^ says this: Might be related to
I can't say anything to this topic specifically, if it's easier to keep a lower C++ standard or check if all our platforms would support 23. |
01406ed to
5e7ecb7
Compare
|
@kaivol one more failure :) ^ @TheOneRing FYI, i can't seem to be able to ask macos and windows to re-run if linux already failed ^ |
5e7ecb7 to
e259baa
Compare
|
I'm a little confused, the CI error seems to be in the OpenVFS plugin, not at all related to my changes 😕 |
|
@kaivol You're right, sorry! |
e259baa to
dbeb743
Compare
|
^ OAuth test fails |
a83044a to
b7e4712
Compare
|
Okay, I adjusted the OAuth test and added a response for the Let me know if you agree with the changes. |
Override openIdConnectScopes() in OpenCloudTheme to include the "groups" scope alongside the default openid/offline_access/email/profile set. IDPs that scope-gate their group claim (Authelia, Keycloak and Authentik in default config) only emit it when the corresponding scope is requested in the authorization request. Without it, server-side role mapping via PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=groups fails with "no roles in user claims" and login dies on the post-OAuth user-info step with "Failed to get user info from server". Stopgap until opencloud-eu#847 (webfinger-based OIDC parameter discovery) lands upstream. Refs opencloud-eu#217. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
I can confirm this PR works, I'm logged in a test server with a different client_id and additional scopes. I'll post my review comments later, it's only small stuff I think. Thank you for the PR @kaivol By the way I see this in log: |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Here in code before, it differs in error signal emission if it's about refresh token or not: While your new code does not: Maybe you could just always emit both in your added code (would need to be checked and tested if really only one is connected)? |
|
I took a look at the current
Also, the Could you please clarify the meaning of |
|
I was more talking about the lack of refreshError being emitted. This is about the refresh token: Signal refreshError (but not error) is connected a few lines above: So _oAuthJob->refreshAuthentication(_refreshToken) is called.
No you're not for the webfinger stuff, see my links ^
I cannot, I'm not versed with this code :) I was only wondering about the error vs refreshError. |
|
@kaivol Do you need any help? Do you want me to do the commit on top of your changes? Other than that, I think your PR could be merged... (if @TheOneRing @dragotin don't disagree) |
| Q_EMIT refreshError(QNetworkReply::NoError, QStringLiteral("Could not parse OIDC discovery response: %1").arg(err.errorString())); | ||
| } else { | ||
| Q_EMIT result(Error); | ||
| } |
There was a problem hiding this comment.
Should there be a return after emitting the error signal?
There was a problem hiding this comment.
Probably yes, although there was not in original code!? https://github.com/opencloud-eu/desktop/pull/847/changes/BASE..52d360a904a9ee83fd8daec331a7b0e9ece1330a#diff-030afc7423b8921f965c6ffa0af5f7312a2e7aa06e1046628ddbde8e6394ac50L599
Maybe check what happens in fetchWellKnownFinished slot what would happen in this path if it is called in that case?
| @@ -689,7 +713,11 @@ void OAuth::fetchWellKnown() | |||
| qCDebug(lcOauth) << u"failed to parse .well-known reply as JSON, server might not support OIDC"; | |||
There was a problem hiding this comment.
While we're at it: Is it correct, that this particular JSON error is handled differently than all other JSON errors?
There was a problem hiding this comment.
Legacy code, might be from long time ago from servers before OIDC? Would need to git blame and git deep to find out this one...
Could still happen with a mis configured server or proxy?
There was a problem hiding this comment.
But now I see what you mean, there is no error emission there either... weird. Should probably also emit error adn return?!
|
@guruz Thanks for the detailed explanation! I cherry-picked your commit, and also added two comments you might want to take a look at. |
79380d7 to
fb59aba
Compare
….well-known/openid-configuration`
fb59aba to
b625d9f
Compare
|
I did some more changes to the error handling, trying to keep your comments in mind. |
Closes #811.
Client side implementation of the changes described in https://github.com/opencloud-eu/opencloud/blob/main/docs/adr/0003-oidc-client-config-discovery.md.
Based on #776.