vouch/vouch-proxy

Interoperability with OAuth2 Server Library for PHP

tgal opened this issue · 6 comments

tgal 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?

tgal commented

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

tgal 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!

tgal 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!