Skip to content

[Question] Client credentials grant in the GenericProvider #1067

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

Open
gdbonino opened this issue Apr 24, 2025 · 0 comments
Open

[Question] Client credentials grant in the GenericProvider #1067

gdbonino opened this issue Apr 24, 2025 · 0 comments

Comments

@gdbonino
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant