Closed caowenbo closed 2 years ago
Thanks for your contribution. Can you please upload a change to this gerrit instance: [1]?
[1] https://gerrit-review.googlesource.com/admin/repos/plugins/oauth
OK,I will.
Hi, how about finishing this issue? We need it as well.
The change is under review already, it would be great if someone could test it and report verified bit: [1].
[1] https://gerrit-review.googlesource.com/c/plugins/oauth/+/234973
We tested @caowenbo change. While changing token extractor is correct, indeed,what is required as well is changing interpretation of user profile response from CAS. The plugin expects list, while an object is returned: https://github.com/davido/gerrit-oauth-provider/blob/master/src/main/java/com/googlesource/gerrit/plugins/oauth/CasOAuthService.java#L113
I couldn't manage to bind CAS accounts into existing ones, even using fix-legacy-user-id = true
.
Thanks for testing. Can you paste (obfuscated) result returned from CAS, it would be easier to change the parsing code. Or could you contribute the missing change?
Response from CAS:
"service": "XXX",
"attributes": {
"authenticationDate": "2019-08-28T08:27:17.395282Z[Etc/UTC]",
"authenticationMethod": "LdapAuthenticationHandler",
"credentialType": "UsernamePasswordCredential",
"email": "XXX",
"isFromNewLogin": "true",
"login": "XXX",
"longTermAuthenticationRequestTokenUsed": "false",
"name": "XXX",
"successfulAuthenticationHandlers": "LdapAuthenticationHandler"
},
"id": "XXX",
"client_id": "gerrit"
}
CAS configuration:
cas.authn.attributeRepository.ldap[0].attributes.cn=name
cas.authn.attributeRepository.ldap[0].attributes.mail=email
cas.authn.attributeRepository.ldap[0].attributes.uid=login
@piotrekfus91,I tested and found the problem you said. I have now added the analysis of Nested structures.At https://gerrit-review.googlesource.com/c/plugins/oauth/+/234973
@caowenbo Thanks for tracking down and fixing the problem. Can someone please confirm that the latest patch set in https://gerrit-review.googlesource.com/c/plugins/oauth/+/234973 works as expected?
The original change was abandoned, so closing this for now.
At CAS V6.0.x the OAuth responses for access tokens is produced as JSON.