Інтеграція гібридного SSO провайдера

In addition to the authentication methods provided by Crowdin, you can use the Single Sign-On (SSO) feature to authenticate your users instantly with their existing usernames.

Ця функція доступна тільки в тарифних планах організації.

Crowdin hybrid SSO is a faster way to create the translator account than classic SSO like OAuth or SAML.

Весь впорядкований процес працює наступним чином:

  1. Увімкніть SSO в своєму обліковому записі та скопіюйте ключ API свого облікового запису.
  2. Create a special URL in your system that redirects a translator to Crowdin. This URL will contain the translator’s authentication information and the API key you received earlier as URL parameters encrypted with AES.
  3. Crowdin використовує ці параметри для створення облікового запису для перекладача і перенаправляє на потрібну сторінку. Наприклад, перекладачі можуть бути негайно перенаправлені в редактор перекладів, щоб почати роботу.
  4. The translator receives an email with instructions on activating the account and must agree to Crowdin’s Terms of Service and Privacy Policy.
Note: Before referring a user to Crowdin, please include a warning that you are sending the translator’s encrypted personal information to the outside party.

If you pass a login name or email to the SSO URL already taken at Crowdin, the user will be asked to correct the registration details.

Увімкнення єдиного входу (SSO)

To enable SSO for your projects, follow these steps:

  1. Go to Account Settings > SSO.
  2. Select Enable single sign-On.
  3. Specify a valid provider’s name.
  4. Click Save.

Параметри URL єдиного входу

Below is the list of parameters you can pass to Crowdin for automatic registration. In this step, you will need to pack the data as a JSON array before encryption (See the sample integrations in popular programming languages below).

Параметр Необхідний Тип За замовчуванням Приклад Примітки
user_id так число 12345678901 A unique identifier for the user (e.g., the user_id in your system).
login так рядок johndoe Ім'я для входу в Crowdin. Має відповідати шаблону [a-z, 0-9]
user_email так рядок john.doe@mail.com Дійсна адреса email
expiration так число 1406124776 Активна часова мітка unix.
Увага! Встановіть не більше 30 хвилин від поточного часу UTC.
display_name рядок Джон Доу Ім'я користувача або справжнє ім'я
locale рядок en_US uk_UK Код локалі
проекти рядок docx-project,csv-project Розділений комами список ідентифікаторів проекту Crowdin, до яких перекладач повинен спочатку мати доступ
стать число 0 1 | 2 1: чоловік, 2: жінка
ролі число 0 0 | 1 | 2 Роль користувача у спільних проектах. 0: перекладач, 1: коректор, 2: менеджер
мови рядок ro,uk,fr Comma separated list of Crowdin language codes the user should have access to. Використовується для проектів з помірною мовною політикою доступу
redirect_to рядок https://uk.crowdin.com/profile https://crowdin.com/project/your-project-url Crowdin URL, куди перекладач повинен перенаправитись після реєстрації
return_crowdin_login число 0 | 1 Повернути параметр GET crowdin_login (працює в поєднанні з параметром redirect_to)

The output JSON array should look like the following:

{
  "user_id":"12345678901",
  "login":"johndoe",
  "user_email":"john.doe@mail.com",
  "display_name":"John Doe",
  "locale":"de-DE",
  "gender":1,
  "projects":"docx-project,csv-project",
  "expiration":1406124776,
  "role":0,
  "redirect_to":"https:\/\/crowdin.com\/project\/docx-project"
}

Шифрування інформації

The JSON created in the previous step must be encrypted using AES 128-CBC, with the first 16 characters of your Crowdin account API key acting as the cipher key, and the last 16 characters as the initialization vector. The encrypted text should be transformed now to Base64 text.

Генерація посилання SSO

The SSO URL should use the following pattern:

https://crowdin.com/join?h={ENCRYPTED_STRING}&uid={CROWDIN_USER_LOGIN}

Where:

{ENCRYPTED_STRING} is the Base64 text you created in the previous step.

{CROWDIN_USER_LOGIN} is the login name of your Crowdin account. Note: this must be the same account you used to create the projects you want the translator to have access to.

Приклади Інтеграції

We’ve created the code snippets for the most major programming languages. Remember to replace CROWDIN_USER_LOGIN and CROWDIN_USER_API_KEY with your personal authentication information.

Ця стаття була корисною?