-
Notifications
You must be signed in to change notification settings - Fork 762
Description
I am using this library through knpuniversity/oauth2-client-bundle
to log in users to my own oAuth2 server. This works great.
The problem I have is that when I want to directly use the Provider configured to get an access token using client_credentials
from the command line, the oAuth2 server bounces me.
What I could verify is that when running the command, the redirect_uri
does not contain the correct URL as the command does not have the context to generate the URL (Symfony routing). Obviously, a solution would be to set the redirect_uri
by hand. But reading the oAuth2 documentation, when using client_credentials
, it is not necessary to send redirect_uri
.
To solve this, I made a local provider by extending GenericProvider
and just overwriting getAccessToken
to remove the redirect_uri
param when it is client_credentials
.
Is what I'm doing correct? If so, I can generate a PR to adjust the functionality directly in GenericProvider.