-
Notifications
You must be signed in to change notification settings - Fork 327
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
supporting openstax oauth, a non-openid-compliant oauth2 provider #139
Comments
thanks for diving into Vouch Proxy @reedstrm and sharing your experience Testing Not specific to this issue, but generally related, I've thought we should probably be using wrt I'd be happy to accept a PR for |
Sure, I'll cut a branch w/ just the don't clobber on it. As to the other, not sure I have sufficiently broad experience to generalize to "other oath2 implementations" I've really only worked with the one. |
#141 has been merged! |
Thanks for vouch, I was able to get it working with our local, home-grown oauth2 provider, but hit two issues. (Bear with me, I'm new to golang)
Took me a bit to realize that I had to provide one of the listed providers, since there's no default fallback for
getUserInfo()
. So, go ahead and useoidc
. This lead to the first, biggest problem, is that our code is oauth2, not OpenID, sovouch
gets through all of the authentication hand-shaking steps, but when going to grab the UserInfo, it falls down on doing the code to token exchange, here:vouch-proxy/handlers/handlers.go
Line 528 in 5f336c4
Since our oauth2 server doesn't sent an id_token (or any Extra, for that matter), this line blows up. As far as I can tell, the
PIdToken
is never used elsewhere invouch-proxy
, so I commented this line out, and make it to the next problem. :-) (BTW, I see value in upgrading our server to provide this JWT token in any case, so this problem may go away, for me. Otherwise, I don't know enough go to test if the providerToken has an Extra member, sorry. )Also, the error for that one looks almost exactly like what was seen here:
#20 (no real hint where the actual problem is)
The next problem seems to be the usual - everyone's UserInfo is different. In our case, emails are nested inside a contacts hash, we provide no top-level email member in the json. We do however, provide a username at the toplevel. So this code:
vouch-proxy/pkg/structs/structs.go
Lines 27 to 29 in 5f336c4
stomps on the username. Which caused the attempt to store in the bold db to fail.
For that fix, I just conditionalized it:
https://github.com/reedstrm/vouch-proxy/blob/21b0770605956be2ee68510589af21751fe86d0a/pkg/structs/structs.go#L27-L32
If we decide to use
vouch
in production, I think I'll just go ahead and define anopenstax
provider, and encapsulate the necessarygetUserInfo
changes there.Just thought I'd share my experience with y'all and get any feedback you might have.
The text was updated successfully, but these errors were encountered: