knpuniversity / oauth2-client-bundle

Easily talk to an OAuth2 server for social functionality in Symfony
https://symfonycasts.com
MIT License
787 stars 145 forks source link

Expose the OAuth error properly in IdentityProviderException #374

Closed uncaught closed 2 years ago

uncaught commented 2 years ago

I can't seem to find an exposed value for the error response in case of an IdentityProviderException.

According to https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-20#section-5.2 there should be a required error repsonse field in case an OAuth call runs into problems. (Like invalid_grant, invalid_scope, etc.).

It seems that the exception message starts with that error, followed by \n, and the underlying stream response looks like a json string with the error field. But parsing either of those seems very hacky - I can't even tell if the stream will always be json or whether the construction of the exception message will always remain like this.

Please provide a proper getter for the OAuth error.

Thank you

uncaught commented 2 years ago

Never mind, wrong repo, the problem is here.