External providers#
List of external providers#
GET https://login.company.com/blitz/api/v3/users/{subjectId}/fa
Getting a list of account links of external identity providers to a user account.
Required permissions: blitz_api_ufa
or blitz_api_sys_ufa
.
Binding type and name (fpType
and fpName
) and the binding identifier (sid
).
Example
GET /blitz/api/v3/users/d2580c98‑e584‑4aad‑a591‑97a8cf45cd2a/fa HTTP/1.1
Authorization: Bearer m9tuVBNUnizkuwFnq95IXQm1XTplXLUFD1O5TUmGij4
Cache-Control: no-cache
[
{
"sid": "1000347601",
"fpType": "esia",
"fpName": "esia_1"
},
{
"sid": "1234",
"fpType": "tcs",
"fpName": "tcs_1"
}
]
Linking a provider by ID#
POST https://login.company.com/blitz/api/v3/users/{subjectId}/fa/{fpType}/{fpName}/{sid}
Linking the account of an external identity provider to a user account, if logging in through an external identity provider was previously performed by other means and the identifier (sid
) of the account in the external identity provider is known.
Required permissions: blitz_api_ufa_chg
or blitz_api_sys_ufa_chg
.
The user’s guid
(subjectId
), the type of external provider (fpType
), the name of the external provider (fpName
) and the account ID in the external provider (sid
).
If the call is successful, 204 No Content
.
Example
POST /blitz/api/v3/users/d2580c98‑e584‑4aad‑a591‑97a8cf45cd2a/fa/tcs/tcs_1/1234 HTTP/1.1
Authorization: Bearer m9tuVBNUnizkuwFnq95IXQm1XTplXLUFD1O5TUmGij4
Linking a provider#
Linking to an external provider account with an unknown account ID in the external provider is carried out in two stages:
Request for linking instructions.
Linking by the user in the browser.
POST https://login.company.com/blitz/api/v2/users/current/fa/bind
Request for linking instructions.
fp
is the identifier of the provider whose profile should be linked to;callback
is the address to which the user should be returned after successfully linking the social network account;isPopup
– whether the identity provider’s page needs to be opened in the popup window (optional).
The redirectTo
parameter with a link to which the user must be directed in the browser to complete the second stage and create a linking of the user account to an external identity provider.
Example
POST /blitz/api/v2/users/current/fa/bind HTTP/1.1
Authorization: Basic ZG5ldm5pay10ZXN0Lm1vcy5ydTphUU56S0JuY2VBQVQwelg
Content-Type: application/json
{
"fp": "vk:vk_1",
"callback": "https://app.company.com/callback"
}
{
"redirectTo": "https://oauth.vk.com/authorize?state=5c415063-a153-424c-af9c-023a6bbf1892&scope=email&redirect_uri=https%3A%2F%2Flogin.company.com%2Fblitz%2Fapi%2Fusers%2Fcurrent%2Ffps%2Fbind%2Fcb%2Fvk%2Fvk_1&client_id=5566286&v=5.52&response_type=code"
}
Deleting a provider linking#
DELETE https://login.company.com/blitz/api/v2/users/{subjectId}/fa/{fpType}/{fpName}/{sid}
Deleting the linking of the external provider to the user.
guid
of the user (subjectId
), type of external provider (fpType
), name of the external provider (fpName
) and the account ID in the external provider (sid
).
Example
DELETE /blitz/api/v3/users/d2580c98‑e584‑4aad‑a591‑97a8cf45cd2a/fa/tcs/tcs_1/1234 HTTP/1.1
Authorization: Bearer m9tuVBNUnizkuwFnq95IXQm1XTplXLUFD1O5TUmGij4