php - Symfony2 FOSOAuthServerBundle grant type password requires client secret -
i'm integrating fosoauthserverbundle handle login mobile app symfony2 backoffice. i've followed instructions of this answer, i've never used oauth2
before i'm bit lost sometimes.
i tried logging in using 'password' grant_type
reason won't work unless specify client_secret
get
parameter. supposed ?
here's request looks like:
http://myserv.local/app_dev.php/oauth/v2/token ?client_id=1_4up4x3hpaask4g0sok0so8sg00gk48c44cc0wkwwsg8048wcog &grant_type=password &username=test@test.com &password=somepassword
it returns response unless client_secret
parameter added:
{"error":"invalid_client","error_description":"the client credentials invalid"}
yes, supposed include client secret. once make request, access_token can used each each future request don't need use credentials or client info again until access_token expires. , when token expires, won't need use user credentials again, can use refresh_token, along client id , secret new access_token. initial request should this:
http://localhost/oauth/v2/token?client_id=[client_id]&client_secret=[secret]&grant_type=password&username=[username]&password=[password]
and in response, access_token, can used this:
http://localhost/api/users?access_token=[access_token]
hopefully clarifies little more you.
Comments
Post a Comment