Skip to content

GetTokenFromUserInfo

Generates an authentication token based on user information. If the user is not found and auto-registration is enabled for the logon provider, the user is automatically created, and an authentication token is returned for the newly registered user. Otherwise, the method returns an authentication token for an already registered user.

Info

The generated token is only used for login purposes and cannot be used as a session token. You may pass this token to the auth parameter to authenticate users and system will issue a new session token for the user.

Required Scope

login

Parameters

Parameter Name Description
apiKey A unique key used to authenticate and authorise the calling system.
userInfo User information.

User Information Parameter

User info parameter is a JSON object that may contain the following fields:

Field Name Description
id Unique identifier of the user. Required.
providerName Name of the logon provider. Required.
name Full name of the user. Required.
email Email address of the user.
firstname First name of the user.
lastname Last name of the user.
language Preferred language of the user.
avatar URLs of avatar. Please see details.
otherProperties Other properties of the user. Please see details.

Other Properties

Other properties object is directly mapped to Person table. For example if you have an Gender field in Person table, related value can be specified in other properties object as follows:

1
2
3
4
5
{
    "otherProperties": {
        "gender": "M"
    }
}

Avatar

Avatar URLs should be provided as a JSON object with the following fields:

Field Name Description
small URL of the small-sized avatar.
normal URL of the normal-sized avatar.
large URL of the large-sized avatar.

Example Call

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
POST https://mydomain.emakin.com/rest/v1/getTokenFromUserInfo

{
     "apiKey": "xxxx",
     "userInfo": {
        "logonProvider": "LinkedIn",
        "id": "wcomx2h3jd",
        "name": "John Doe",
        "email": "[email protected]"
     }
}
1
2
3
4
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

"41AA3CE3CAFB..............BF8114"