vouch / vouch-proxy

an SSO and OAuth / OIDC login solution for Nginx using the auth_request module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interoperability with OAuth2 Server Library for PHP

tgal opened this issue · comments

commented

When trying to get Vouch to talk to a Symfony app with this PHP library (see https://github.com/bshaffer/oauth2-server-bundle) after successful authentication Vouch aborts with this error message:

INFO    OpenID userinfo body: %!(EXTRA string={"id":"me@myemailprovider.com","name":" "})
ERROR   json: cannot unmarshal string into Go struct field User.id of type int

The email address (me@myemailprovider.com) in the OpenID userinfo body is the primary user id in the Symfony app and I am expecting it in the X-Vouch-User HTTP header.

Any hints what's wrong here?

commented

No, unfortunately it is not possible to remove the 'id' field or have it return an integer.

commented

Thanks for your reply, after all it was possible to have PHP return the OpenID userinfo as 'email' and now it all works. Thanks for providing this excellent piece of software!

commented

It was not the PHP library's fault and least of all, Vault's. The PHP app's user_info_url endpoint now simply returns {"email":"me@myemailprovider.com"} instead of formerly {"id":"me@myemailprovider.com"}. It was a change in the way the PHP library was used. Thanks again!