Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shintaro's avatar

laravel passport client_credentials

i just want to ask if any one is using this https://laravel.com/docs/5.4/passport#client-credentials-grant-tokens im having problem in the return request

this is my post data in POSTMAN

{ "grant_type": "client_credentials", "client_id": "1", "client_secret": "W34UQ1bZGzqEY2D0mx...", "scope": "" }

this is my url www.sample.com/oauth/token

and my return is this { "error": "unsupported_grant_type", "message": "The authorization grant type is not supported by the authorization server.", "hint": "Check the grant_type parameter" }

i just want to have access_token, expires_in, token_type from the grant type client_credentials thanks for the help !!

0 likes
9 replies
guru.as3's avatar

Have you put your post data in "Body" tab in "form-data" fields?

2 likes
KenoKokoro's avatar

If you have json data to postman, set the headers on the request as well:

Content-Type: application/json

shintaro's avatar

@guru.as3 i already did that this is the response

{ "error": "unsupported_grant_type", "message": "The authorization grant type is not supported by the authorization server.", "hint": "Check the grant_type parameter" }

KenoKokoro's avatar

@shintaro What usually works for me is :

Set body as raw and select on the dropdown JSON ( which will also provide formating and syntax on the input inside ), set the Accept header to application/json and Content-Type application json

shintaro's avatar

@KenoKokoro I already did that but also same results like this

{"error":"unsupported_grant_type","message":"The authorization grant type is not supported by the authorization server.","hint":"Check the grant_type parameter"}

but i try the password grant type and it works is laravel passport works ?

stephen.holt@speechlink.co.uk's avatar

To anyone coming back to this in the future, you will get this message back from incorrectly formatted requests in postman.

I had mistakenly added parameters instead of body.form-data

Correcting this returns the expected token in Laravel 5.7.

1 like

Please or to participate in this conversation.