Use OAuth 2.0 protocol to securely authorize third-party applications and web services you integrate with Creatio. This technology does not pass Creatio logins and passwords to third-party applications. OAuth 2.0 also lets you restrict Creatio permissions for the integrated applications.
Install and set up the Identity Service
Deploy the database and Creatio application servers before installing and configuring the Identity Service. To install the Identity Service:
- Access the Creatio application server.
- Install the .NET Core runtime 2.2. Download the install file
- Install the .NET Core Hosting Bundle. Download the install file
- Restart the IIS.
- Navigate to the Creatio install file folder, find the IdentityService.zip archive, and unzip it.
- Add the Identity Service application pool to the IIS.
- Go to the Application Pools section in the Connections area of the IIS management window.
- Select Add Application Pool… in the Actions area.
Fig. 1 Add the pool to the IIS
- Specify the pool name in the pool settings window, for example, “IdentityServicePool.” Set the .NET CLR Version field to “No Managed Code.”
Fig. 2 Set up the Identity Service pool
- Set up access to the application pool:
- Right-click the newly-created pool. Select Advanced Settings… in the context menu.
- Specify the user with Identity Service directory access permissions in the Identity field of the newly-opened window.
- Create a new Identity Service site in the IIS.
-
Click Sites on the IIS control panel and select Add Website from the context menu.
-
Specify the site name, the pool and the path to the Identity Service root directory.
Fig. 3 Set up the site in the IIS
-
-
Connect the site to your Creatio DBMS. To do so, edit the appSettings.json configuration file in the Identity Service root directory:
-
Set the “DbProvider” parameter to “MsSqlServer” or “Postgres.”
-
Specify the connection string in the “MsSqlConnection” or “PostgresConnection” setting. We recommend using the same connection string you specified in Creatio. The user that connects to the database must have permissions to create and update the tables.
-
-
Set up the Identity Service system user. To do so, specify the unique ClientId, ClientName, and ClientSecret values in the “Clients” block of the appSettings.json configuration file. The file is located in the Identity Service root catalog. Creatio and the Identity Service will use these values to interact with each other. All parameters support uppercase and lowercase letters, numbers, and special characters, for example, brackets or punctuation marks.
Recommended parameters:
ClientId — 16 characters.
ClientSecret — 32 characters.
ClientName — any number of characters.
“Clients” block setup example: - Switch the Identity Service to HTTPS. The setup process is similar to switching Creatio to HTTPS. Read more: Switch Creatio website from HTTP to HTTPS.
- Enable the Identity Service logging.
- Navigate to the Identity Service directory, open the web.config file, and set the “stdoutLogEnabled” parameter to “true.”
- Specify where you would like to store the Identity Service logs in the file's “stdoutLogFile” parameter.
- Open the appsettings.json file in the Identity Service root directory and configure the log level:
Set up the Identity Service integration on Creatio's end
- Enable the OAuth 2.0 integration in Creatio. To do so, execute this script in your Creatio database. Use it for both Microsoft SQL and PostgreSql.
- Fill in the system settings in the “OAuth 2.0” group:
- “Authorization server Url for OAuth 2.0 integrations” (“OAuth20IdentityServerUrl” code) — the IdentityServer URL, for instance, http://isEnpointExample.
- “Client id for OAuth 2.0 integrations” (“OAuth20IdentityServerClientId” code) — the Identity Service user ID you specified in the “ClientId” parameter of the appSettings.json file when setting up the IdentityServer.
- “Client secret for OAuth 2.0 integrations” (“OAuth20IdentityServerClientSecret” code) — the Identity Service user's secret key you specified in the “ClientSecret” parameter of the appSettings.json file when setting up the IdentityServer.
- Create a default resource. You only need to perform this action once when setting up the Identity Service integration.
- Click
to open the System Designer.
- Open the OAuth 2.0 integrated applications section.
- Select Create default resource in the Actions menu.
Fig. 4 Add a default resource
- Click
This will create a default resource record with your Identity Service account details.
Set up the OAuth 2.0 authorization
Once you install the Identity Service and connect it to Creatio, add a client record for each application you are going to authorize with OAuth 2.0. To do so:
- Click
to open the System Designer.
- Open the OAuth 2.0 integrated applications section.
- Click New.
- Fill in the client parameters for the relevant application on the newly-opened page.
- Name — the title that the integration list and the logs will use.
- Application URL — the URL of the integrated application or the web service.
- Description — the purpose of the integration.
- Active — enables and disables the integration.
-
System user — the Creatio user with sufficient permissions for this integration. We recommend permitting this user to only read and edit the fields the integrated application or the web service need to change. For example, if you are integrating a web service that passes the currency exchange rates to Creatio, grant permissions to only read and edit the Rate and Start fields of the Currency lookup.
Creatio automatically populates the client account details (the ID and the secret).
Fig. 5 Set the client
- Save the record.
- Repeat steps 3-6 for all applications you need to authorize with OAuth 2.0.