API: User Auth - GeoTappy/geo_tappy_rails GitHub Wiki

Email & Password

{
  "client_id": "client_id",
  "client_secret": "client_secret",
  "grant_type": "password",
  "email": "[email protected]",
  "password": "test1234"
}

Example response

Correct

{
  "access_token":"fc8de38185a6e531be5e6f1dfc5807b5789c82647f34ad6f045c54172becc43d",
  "token_type":"bearer",
  "expires_in":7200,
  "refresh_token":"8bb60a361a8deaa8e284c64aa7dc2bbd5c437b274b8a8f7840a6ace3032efae9"
}

Error

{
  "error":"invalid_resource_owner",
  "error_description":"The provided resource owner credentials are not valid, or resource owner cannot be found"
}

Facebook auth

POST /oauth/token.json

{
  "client_id":"client_id",
  "client_secret":"client_secret",
  "grant_type":"password",
  "provider":"facebook",
  "token":"token_received_from_facebook"
}

Note: token_received_from_facebook should allow to get email, profile picture & list of friends