Authenticate a Social Login

Endpoint URL: {socialLoginDomain} /api/v2/auth_info



Description

Authenticates Social Login users. Note that you must use HTTPS to make this call.

During the authentication process, the auth_info call retrieves the profile information of the user. Using the apiKey of the application, and the one time token provided by Social Login, this endpoint returns the requested data from the Identity Provider.


Accepted Content-types

  • application/x-www-form-urlencoded
  • multipart/form-data


accessCredentials Fields

The list below shows the fields returned by accessCredentials, listed by Provider.

  • Amazon — accessToken, uid, expires, refreshToken, scopes
  • Disqus — accessToken, uuid, expires, refreshToken, type
  • Facebook — accessToken, expires, uid, type
  • Flickr, Yahoo! — oauthToken, oauthSessionHandle, oauthTokenSecret, type
  • Google — oauthToken, oauthTokenSecret, scopes, type
  • Instagram — accessToken, uid, scopes, type
  • LinkedIn, Twitter — oauthToken, oauthTokenSecret, type
  • Mixi — accessToken, refreshToken, expires, scopes
  • QQ — accessToken, uid, scopes, type
  • Ren Ren — type, oauthToken, uid, expires
  • Sina Weibo — type, oauthToken, uid
  • tumblr — oauthToken, oauthTokenSecret, uid, type
  • VK — accessToken, uuid, expires, scopes, types
  • Microsoft Account — eact, type
  • Provider Fields

The list below shows the fields returned by provider, listed by provider.

  • Facebook — albums, games, groups, videos
  • Foursquare — type, pings, relationship
  • LinkedIn — associations, patents, numRecommenders, industry, following, courses, certifications, publications, positions, jobBookmarks, honors, groupMemberships, mFeedRssUrl, skills, proposalComments, recommendations, volunteer
  • Mixi — occupation, bloodType, favoriteThings
  • SalesForce — local, userType, active


Authentication

This endpoint uses your social login API key for authentication. This key can be found on the Settings page of the Social Login Dashboard. 


Base URL

The base URL for this endpoint is your application domain followed by /api/v2; for example:

https://educationcenter.rpxnow.com/api/v2

You can find your application domain in the Social Login (Engage Dashboard) on the Settings page:

Example Request

This command authenticates a social login user.


curl -X POST \
  --data-urlencode apiKey=1234567891234567891234567891234567891234\
  --data-urlencode token=a1b2c3d4e5f6g7h8i9j0\
  https://janrain-docs.rpxnow.com/api/v2/auth_info

      Running this command in Postman


Example Response


{
  "profile": {
    "name": {
      "givenName": "Sam",
      "familyName": "Knot",
      "formatted": "Sam Knot"
    },
    "verifiedEmail": "sam@example.com",
    "googleUserId": "123456789123456789123",
    "displayName": "sam",
    "preferredUsername": "sam",
    "url": "https://www.google.com/profiles/123456789123456789123",
    "providerName": "Google",
    "identifier": "https://www.google.com/profiles/123456789123456789123",
    "email": "sam@example.com"
  },
  "accessCredentials": {
    "scopes": "Blogger,Google Buzz,Google Contacts,YouTube,Picasa Web Albums,Google Calendar,Google Docs",
    "oauthToken": "1/1234567891234567891234567891234567891234567",
    "type": "OAuth",
    "oauthTokenSecret": "123456789123456789123456"
  },
  "merged_poco": {
    "urls": [
      {
        "type": "other",
        "value": "https://www.google.com/profiles/123456789123456789123"
      }
    ],
    "preferredUsername": "Sam",
    "name": {
      "formatted": "Sam Knot",
      "familyName": "Knot",
      "givenName": "Sam"
    },
    "languagesSpoken": [
      "en"
    ],
    "emails": [
      {
        "type": "other",
        "value": "sam@example.com"
      }
    ]
  },
  "stat": "ok"
}      


Query Parameters

ParameterTypeRequiredDescription
apiKeystringYesSocial Login API key. This key can be found on the Social Login Dashboard.
 
extendedstring
When true, returns the extended Simple Registration and HCard data in addition to the normalized Portable Contacts format. The default value is false.
 
tokenstringYesSocial Login auth_info token.
 
tokenUrlstring
Validates the specified token URL value against the URL that was originally sent. See the 'Token URL mismatch' response example below for more details.
 


Responses

200 OK

Response Fields

Field

Type

Description

profile

dictionary

A dictionary of fields forming the user's profile. This data may have been obtained through SREG, HCard, but is represented in the standard Portable Contacts schema.

accessCredentials

dictionary

If the user logged in with a provider that allows account access after authentication, this will be present and contain the user's authorization credentials. The fields returned differ by provider and are referenced in the "accessCredentials Fields" section at the top of this page.

merged_poco

dictionary

Merged Portable Contacts data will be present here if the extended request argument was true and extended profile data were available.

friends

array

The user's friends' identifiers will be present here if the extended request argument was true and friends data is available.

following

array

Supported by Twitter, Sound Cloud, and Sina Weibo only. The people whom the user is following will be present here if the extended request argument was true.

followers

array

Supported by Twitter, Sound Cloud, and Sina Weibo only. The people who follow the user will be present here if the extended request argument was true.

friendships

array

Supported by Twitter, Sound Cloud, and Sina Weibo only. People who are both following and followers will be present here if the extended request argument was true.