-
Notifications
You must be signed in to change notification settings - Fork 51
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
Can't authenticate with client_credentials grant #68
Comments
@aukraiser Thanks for your issue. Did you solve the problem already? It's really a problem. The middleware public function handle(Request $request, Closure $next)
{
$this->defaultApiProvider = config('auth.guards.api.provider');
$provider = $request->get('provider');
if ($this->invalidProvider($provider)) { // HERE
throw OAuthServerException::invalidRequest('provider');
}
config(['auth.guards.api.provider' => $provider]);
return $next($request);
} I think that if we check if the grant type is Can you create Pull Request, please? |
@sfelix-martins How about setting a provider in oauth_access_token_providers to be nullable? It works for me. Of course AddCustomProvider.php must be modified to ignore client_credentials grant_type request. |
@sfelix-martins I'm so sorry for the delayed response. Basically what I did was adding the The solution you propose is quite a good one. Did you implement it or do you still need someone to make a pull request? |
@aukraiser can you create pull request? It would help me a lot! Thanks! |
@sfelix-martins Ok, I'll try to do that today or tomorrow 👍 |
@sfelix-martins, the pull request is created and can be seen here. Hope it'll help 😃 |
@aukraiser thanks bro. I will check to accept ASAP. |
@sfelix-martins I face this issue now. Could you please check the pull request? Thanks. |
First of all thanks for this awesome package !
I seem to have an issue with client_credentials grant that look like this one #33.
When I try to authenticate a client using client_credentials I get an error from the AddCustomProvider rejecting my request because I did not specify a provider.
My request contains the requested parameters for a client_credentials:
The AddCustomProvider answers
If I specify a provider I can authenticate (but I shouldn't have to because I am not trying to authenticate a user).
If I unwrap the
Passport::routes
in theAuthServiceProvider
I can authenticate my client without passing a provider but then the user authentication does not work anymore.Could it be possible to check for the
provider
param only in the context of an user authentication ?The text was updated successfully, but these errors were encountered: