Social Login
Supported identity providers
More coming soon ...
Logical flow
The below chart goes over the logical flow of the SOCIAL LOGIN service and the process for retrieving data from the Social Providers.
1. Display the Social Login interface on your page.
2. Once a user has selected the Social Provider they would like to use they will be prompted to input their credentials in an authentication interface that is managed by the Social Providers. Permission to access their data will also happen at this time.
3. After successful authentication the interface will return a specific access token to your Server.
4. Request User Profile data or extended data like Groups and Contacts via the RUBYMAGE Social APIs. If the user has granted permissions you can also message friends or do Push Notifications.
5. All of the API endpoints return normalized responses in JSON format.
API details
Definition
Your app must initiate a redirect to RUBYMAGE social-login endpoint which in turn will redirect the user to the chosen provider and will display the login dialog:
https://rubymage.com/api/v1/social-login/?
provider=:provider&
redirect_uri=https://yourdomain.com/callback
Parameters
Parameter | Values | Description |
---|---|---|
provider | Identity Provider | Required. Available values: facebook, google, yahoo, twitter, odnoklassniki, amazon, instagram, linkedin, vkontakte, windowslive, paypal, tumblr, yandex, mailru |
redirect_uri | One of the redirect_uri values listed for this app in the RUBYMAGE Account. It must be URL encoded | Required. Determines where the response is sent. The value of this parameter must exactly match one of the values listed for this app in the RUBYMAGE Account (including the http or https scheme, case, and trailing '/'). |
Response
The callback request will contain code parameter.
Try It Out
Get user profile
Definition
In context of Social Login you can get user profile data by making a request to user's endpoint with the code parameter you received on the previous step.
GET https://rubymage.com/api/v1/users/?code=:code
Response
200 OK
Content-Type: application/json
{
"id" : "3273102058988270",
"displayName" : "Sergiu Ghenciu",
"name" : {
"familyName" : "Ghenciu",
"givenName" : "Sergiu",
"middleName" : null
},
"gender" : "male",
"emails" : [
{
"value" : "1024gs@gmail.com"
}
],
"provider" : "facebook"
}