-
Notifications
You must be signed in to change notification settings - Fork 5
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: dCacheView has client scope hardcoded, ignores client definition in IAM OIDC provider #292
Comments
I tried to work around it:
But that doesn't work. I wasn't able to find any other location where this scope is defined. Clearly my understanding of dCacheView and how it is integrated into dCache is insufficient to change this myself. |
The change looks reasonable to me: I can't see anything obviously wrong. It could be that your client needs to be authorised to "see" (i.e., to obtain a token with) the |
Hi Paul, I have checked the client definition over and over again, but the wlcg.groups is checked in the scope. So I really don't understand why it is not included in the token. The token payload:
The client ID is correctly defined, I hope:
I have tried debugging the IAM traffic with the browser console, but somehow I couldn't see that traffic; only the dCacheView-browser traffic. |
Now here's a weird thing. My colleague Natalie just registered at the Escape IAM, and got her ID (sub). When she gets a token, the
She's not in any groups yet, though. That's probably why there are no groups listed. |
For Natalie, after she was admitted to the groups, we now receive the group info in dCache.
For me, we still don't. Here's a fresh token payload:
Does dCache somehow cache things like the scope in a user profile? Authentication still fails, also for Natalie, because of this error:
I really have no idea where that came from. Haven't seen it before yesterday. |
The It looks like this claim was somehow missing. |
But Paul, I can see the I'm using yesterday's master snapshot. |
There's (at least) three possibilities:
|
Happy to help debugging this, tell me what you need. |
Here's how you can look up a token, using the user-info endpoint. I'm using oidc-agent to get the token (as paul@celebrimbor:~$ curl -s https://iam-escape.cloud.cnaf.infn.it/.well-known/openid-configuration | jq -r .userinfo_endpoint
https://iam-escape.cloud.cnaf.infn.it/userinfo
paul@celebrimbor:~$ TOKEN=$(oidc-token ESCAPE)
paul@celebrimbor:~$ curl -s -H "Authorization: Bearer $TOKEN" https://iam-escape.cloud.cnaf.infn.it/userinfo | jq .
{
"sub": "c95caedb-97dd-4335-bbb9-b31919961132",
"name": "Paul Millar",
"preferred_username": "paul",
"given_name": "Paul",
"family_name": "Millar",
"updated_at": 1605380764
}
paul@celebrimbor:~$ The first curl command is to look up the userinfo endpoint. I think you can just use the value |
In general, dCache has a couple of ways it can obtain information about the user from a token. If the token is a JWT then dCache can obtain the information directly; otherwise, it can contact the user-info endpoint. One possible explanation is that dCache is (for whatever reason) using the user-info endpoint with your token, instead of reading the data directly from the JWT. |
Thanks Paul! Here's my user info:
That was with a fresh token from oidc-token. Then I tried a token I obtained from the gPlazma log:
|
Indeed, in the gPlazma log I found that gPlazma reaches out to the /userinfo.
The token used has this payload:
For Natalie, gPlazma does the same, but it uses a token with this payload:
That probably explains why the /userinfo result is different. I've collected some debug logs and sent them to your email address. |
I made a small step forward, regarding the It turns out, that when I remove the
and restart dCache (not sure if that is needed), the |
Actually, I think this is pretty clear. Earlier you posted the JWT payload that identifies yourself. This included the You also posted the user-info endpoint response, when you use your access token (i.e., the JWT) to authenticate. This clearly does NOT include the You have configured dCache to expect the OP to conform to the WLCG JWT Profile. This profile requires the OP to include the If you do not include With Therefore, the error message ( |
Thanks for explaining! I'm glad you understand. Looking forward to the workshop to improve my understanding of OIDC. It's still not clear to me whether this is desired behaviour. Should the userinfo include wlcg.ver? Or should dCache accept that the userinfo doesn't have wlcg.ver? |
I think it's rather unclear what is correct behaviour. Switching off So, I would say the way forward would be to switch off |
Dear dCache devs,
I couldn't get dCacheView on our 9.1 test instance to authenticate with group memberships. You may have seen my posts about this on the dCache user mailing list. In my client definition at the Escape IAM (https://iam-escape.cloud.cnaf.infn.it/iam/api/client-registration/aa4d4818-0e88-4f47-90b9-dd2ef5e84cf8) I added wlcg.groups to the scope, but it was always ignored; in the token that was returned to gPlazma, the scope was always this:
I just found out that this is hardcoded in the dCacheView source:
dcache-view/src/elements/dv-elements/user-authentication/forms/loginform-with-openid.html
Line 297 in 6afb479
Any suggestions on how to configure user mappings based on wlcg.groups information? Or is this not supported in dCacheView, and should we look for another client to test OIDC? For now I guess we could add wlcg.groups to the source, but it feels a bit clunky.
Kind regards,
Onno
The text was updated successfully, but these errors were encountered: