# SmartRecruiters

#### SmartRecruiters Configuration

* Log into your SmartRecruiters admin session and in the Settings go to Web SSO

* Enable Web SSO, edit the configuration and choose an algorithm and a certificate in the SmartRecruiters Configuration section, it doesn't matter which ones

* Then fill the following parameters:
  * Identity Provider URL

  ```exp
  https://mydomain.trustelem.com/app/33XXXX
  ```

  * Identity Provider certificate

  ```exp
  $cert = "MIIDXXX...XXXNTYw=="
  ```

  * NameID Format

  ```exp
  urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
  ```

#### Trustelem Configuration

* On Trustelem, fill SmartRecruiters company identifier with the corresponding value

    Notes:

  * There isn't additional configuration for the mobile application

  * For a direct authentication, use the link: `https://www.smartrecruiters.com/web-sso/saml/[CompanyIdentifier]/login`

  * The users manually created in SmartRecruiters can't authenticate with SSO because they don't have a SSO identifier, but you can add one with the API

  * For a SSO Identifier update for existing users, all users can be changed at once by asking the SmartRecruiters support team*

#### Add/edit a user with a SSO Identifier using API

* Create an API key on this [page](https://www.smartrecruiters.com/account/sign-in?redir=%2Fsettings%2Fconfiguration%2Fapi-integrations) or copy the existing one

* Then on this [page](https://dev.smartrecruiters.com/customer-api/live-docs/user-api/#/users) paste the API key on X-SmartToken

* To create a new user:
  * In POST/users click on Try it out and paste this model adapted for your user:

  ```exp
  {
      "email": "user-email-address",
      "firstName": "user-firstname",
      "lastName": "user-lastname",
      "systemRole": {
      "id": "role-id",
      "name": "role-name"
      },
      "ssoIdentifier": "user-email-address"
  }
  ```

  * Execute en copy the replied user id

  * In PUT/users/{id}/activation, click on Try it out, paste the user id and execute

* To update an existing user:

  * In GET/users click on Try it out, execute and copy the id of the wanted user

  * In PATCH/users/{id} click on Try it out, paste the user id and then the following model adapted for your user:

  ```exp
  [ { "op":"add", "path":"/ssoIdentifier", "value":"user-email-address" }]
  ```