Open a760109 opened 6 years ago
@mwebber Any idea what could be wrong?
Thanks for a clear report with all the relevant info provided up-front.
It is working for us (also Gerrit 2.14.5.1, gerrit-oauth-provider 2.14.3, CAS 5.1.?). There are a few differences between our configurations:
In gerrit.config
, we don't have any value for gerrit-oauth-provider-cas-oauth.client-secret
. Instead, that is stored in secure.config
. I'd start by fixing that up.
Both my Gerrit and CAS are using https. My CAS oauth service definition is similar to yours
{
"@class" : "org.apereo.cas.support.oauth.services.OAuthRegisteredService",
"clientId": "gerrit",
"clientSecret": "XXXXX",
"bypassApprovalPrompt": true,
"generateRefreshToken": false,
"serviceId" : "https://gerrit[a-z]*.XXX.YYY.ZZZ/oauth",
"name" : "Gerrit",
"description" : "Gerrit",
"id" : nnnnnnnnnn
}
Can you fix the location of the client-secret
and report back?
Hi @mwebber
Thanks you feedback, I think maybe the HTTP issue, I will try to use HTTPS protocol.. In CAS, i use HTTPS have some trouble, I will try to fix it. (Error: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden")
by the way, this is my secure.config context
[auth] registerEmailPrivateKey = 2PZO0bAN5JoefHybTay6tHJGR/Pjsz7EKGw=
Thnaks.
Hi @mwebber
I success login by HTTP, i change the CAS ticket type from TGC to ST. In my work environment, network need use Proxy , so HTTPS have some trouble.
this is my CAS setting: cas.tgc.secure=false cas.tgc.name=ST
By the way , i login Gerrit username is "Anonymous Coward (1000001)", is't possible auto use CAS Username and Email ?
thanks so much.
Hi
i follow the doc(https://github.com/davido/gerrit-oauth-provider/blob/master/src/main/resources/Documentation/config.md), add name and email attributes in CAS properties, and use postman with oauth2.0 to verification, but when i login Gerrit Profile all empty..Which step is wrong?
Thanks.
CAS properties
cas.authn.ldap[0].principalAttributeList=cn:name,mail:email
CAS log
[16:10:19][INFO ][org.apereo.cas.authentication.AbstractAuthenticationManager][default task-504] - Authenticated principal [kent_lu] with attributes [{email=Kent_Lu@***, name=Lu. Kent (TPE)}] via credentials [[kent_lu]].
Postman
**_
I'm using
Gerrit 2.14.5.1 gerrit-oauth-provider 2.14.3 CAS 5.1.5
CA Login view
Here is my gerrit config for oauth
Here is my CAS oauth service definition
Here is the relevant log snippet from the cas.log
Here is the relevant log snippet from the gerrit.log