1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Develop
  5. Simple Tasks
  6. Action Tasks
  7. API Request Tab – Authentication Settings for an Action Task

API Request Tab – Authentication Settings for an Action Task

Depending on the Bot action task, you may need to define how a user must authenticate to initiate the action task. For example, Twitter can have an action task using web services that require an end-user to authenticate, usually with a log on username and password, to allow Kore.ai to access the end-user account for data before executing the action task.

After you define the general settings for an action task, the next step is to go to the Authentication section on the API Request tab shown in the following illustration.

Action Task - API Request Tab - Authentication Section

To get started with defining the Authentication for a task, on the API Request tab, click the Expand  icon in the Authentication section.

If you have previously defined authentication for this task, you can select it in the Authorization Provider drop-down list. If your task does not require authentication, you can select None in the Authorization provider drop-down list as shown in the following image.

Action Task - API Request Tab - Authentication Section Options

To define a new authorization provider, click Create New to display the New Authorization Mechanism dialog.

In the Authentication Type drop-down list, select the type of authorization used by your Bot as shown in the following illustration.

New Authorization Mechanism Dialog

You can choose one of the following types of authorization:

  • Basic Auth – A standard protocol to collect username and password information. Kore.ai uses SSL encryption in combination with basic authentication to help secure end-user information.
  • OAuth v2 password grant type – Define a custom authorization type for non-standard web service authorization types.
  • OAuth v1 – Enables web applications or web services to access protected resources using an API without end-users having to disclose their log on credentials to Kore.ai.
  • OAuth v2 – The newest version of OAuth protocol focusing on specific authorization flows for web applications and web services.
  • API Key – An identification and authorization token generated or provided by a web application or web service used to identify the incoming application request, and in some cases, also provides authentication for secure access.

Setting Up Authorization using Basic Auth

The following illustration is an example of the Basic Auth fields that you must define to enable basic authorization for your task.

To define basic authorization, select Basic Auth in the Authorization Type field. Then specify a Name for the authorization to be displayed in the Bot builder user interface.

Defining Tenancy

If required, in the Subdomain section, select Yes if the base URL for a web application or user interface the uses a tenant name in the URL. For example, kore is the tenant organization for a web service using tenants as www.kore.someCompany.com.

In the following example configuration, the tenancy URL contains the {tenant} organization placeholder.

Adding Authorization Fields

By default, authorization fields are configured as part of the header of the task request message. If your task request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click + Add Authorization Field and then define the fields as shown in the following illustration.

In the Field Type field, you can select one of the following depending on where in the task request message and the type of authorization fields that are required.

  • Header – The Bot expects the authorization fields as part of the header of the request.
  • Payload – The Bot expects the authorization fields as part of the content of the body of the request.
  • Query String – The Bot expects the authorization fields as a query in the body of the request.
  • Path Param – The Bot expects the authorization fields as part of the URL path for the request.

In the Field Key field, enter the name of the field for the selected Field Type.

In the Field Value field, enter the value for the Field Key specified.

Click Add. The new authorization field is added in the Authorization Fields section.

To add additional authorization fields, click Add in the Authorization Fields section.

Adding Form Fields to the Authorization Form

If the default username and password fields do not meet your needs, you can add new fields displayed to the end-user by adding authorization form fields. To add fields on the authorization form, click + Add Form Field. The following illustration is an example of a definition to add a password field to the authorization dialog.

The following table describes the fields used to define an authorization IDP form field.

FIELD NAME DESCRIPTION
Title of Field Specify the name of the field displayed to the end-user in the authentication dialog.
Field Key The value represents the end-user input value to the authenticating service.
Help Hint The help text displayed in the field to describe what should be entered into the field.
Field Type When Advanced Options is selected, specify the type of field displayed in the end-user interface to collect the user input assigned as the value for the Field Key, one of:

  • Textbox
  • Password
Mandatory When Advanced Options is selected, select if the end-user must define this field to complete authentication.
Data Type When Advanced Options is selected, specify the type of data expected as input from the end-user, for example, String.
Visibility When Advanced Options is selected, specify if the authentication field should be visible, hidden, or displayed as read-only.

In the Authorization Check URL field, optionally define a URL that can be used to test the authentication settings from Bot Builder before you deploy the task with the authorization mechanism. You can use dynamic fields, path parameter fields, query fields, and so forth, to define the test URL, for example,

https://kore.someCompany.com/sap/opu/odata/sap/{{authfield1}}/?$format=json

In the Access Using a Connector section, select Yes to enable access for Kore.ai Bots using the Kore.ai Connector agent. If your domain does not have any active Kore.ai Connectors defined, a warning message is displayed to contact the Bots Admin Console system administrator. For more information, see Using the Kore.ai Connector in the Bots Admin Console documentation.

Click Save to save the authorization settings and close the New Authorization Mechanism dialog.

Testing the Authorization – Basic Auth

After you save the authentication, if you defined an Authorization Check URL for your new authorization type, you can test your authorization definition on the Authentication tab when you click Test Authorization before continuing to develop the remaining steps of your task.

Test Authorization

When you click Test Authorization, the Test Authorization dialog is displayed and populated with the URL you specified in the Authorization Check URL section, as shown in the following illustration.

To configure the Test Authorization – Basic Auth

  1. In the Auth Check URL field, verify or enter the URL to test the authentication configuration.
  2. If your bot uses subdomains, the Tenancy field is displayed and you must specify the tenant.
  3. Enter your User Name and Password for the web service.
  4. Select the content type expected for the URL in the Content-Type field.
  5. For testing the URL, the Method field is read-only and set to GET.
  6. Click Test to begin the authorization test.

When the validation of authentication is complete, the Test Authorization dialog is closed and the results of the validation, either success or failed, is displayed to the immediate right of the Test Authorization button as shown in the following illustration.

Test Authentication - Success

If the authorization fails, the Auth Test Failed message is displayed along with the Headers and Response tabs as shown in the following illustration.

Authentication Test Fail

How it all Works – Basic Auth

When basic authorization is used for a task, the Kore.ai application automatically prompts the user for log on credentials to access the web application or web service as shown in the following illustration.

DIYBasicAuthRequest

After the end-user authenticates, the settings are saved using the following naming syntax:

{{ First Name }} {{ Last Name }} {{ Bot Name }} {{ Account # }} {{ Sequence # }}

For example, John Smith’s Twitter Account #1.

The Kore.ai application can access the web application or web service for all future task requests using this account. In addition, the end-user can reuse the account for other tasks for the same Bot.

Setting Up Authorization using oAuth v2 password grant

The following illustration is an example of the oAuth v2 password grant authorization type fields that you must define to enable a customized authorization for your task.

New Authorization Mechanism Dialog - oAuth v2 password grant

To define a custom authorization, select oAuth v2 password grant in the Authorization Type field. Then specify a Name for the authorization to be displayed in the Bot builder user interface.

Defining Tenancy

If required, in the Subdomain section, select Yes if the base URL for a web application or user interface the uses a tenant name in the URL. For example, kore is the tenant organization for a web service using tenants as www.kore.someCompany.com.

In the following example configuration, the tenancy URL contains the {tenant} organization placeholder.

Adding Authorization Fields

By default, authorization fields are configured as part of the header of the task request message. If your task request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click + Add Authorization Field and then define the fields as shown in the following illustration.

In the Field Type field, you can select one of the following depending on where in the task request message and the type of authorization fields that are required.

  • Header – The Bot expects the authorization fields as part of the header of the request.
  • Payload – The Bot expects the authorization fields as part of the content of the body of the request.
  • Query String – The Bot expects the authorization fields as a query in the body of the request.
  • Path Param – The Bot expects the authorization fields as part of the URL path for the request.

In the Field Key field, enter the name of the field for the selected Field Type.

In the Field Value field, enter the value for the Field Key specified.

Click Add. The new authorization field is added in the Authorization Fields section.

To add additional authorization fields, click Add in the Authorization Fields section.

Adding Form Fields to the Authorization Form

If the default username and password fields do not meet your needs, you can add new fields displayed to the end-user by adding authorization form fields. To add fields on the authorization form, click + Add Form Field. The following illustration is an example of a definition to add a password field to the authorization dialog.

The following table describes the fields used to define an authorization IDP form field.

FIELD NAME DESCRIPTION
Title of Field Specify the name of the field displayed to the end-user in the authentication dialog.
Field Key The value represents the end-user input value to the authenticating service.
Help Hint The help text displayed in the field to describe what should be entered into the field.
Field Type When Advanced Options is selected, specify the type of field displayed in the end-user interface to collect the user input assigned as the value for the Field Key, one of:

  • Textbox
  • Password
Mandatory When Advanced Options is selected, select if the end-user must define this field to complete authentication.
Data Type When Advanced Options is selected, specify the type of data expected as input from the end-user, for example, String.
Visibility When Advanced Options is selected, specify if the authentication field should be visible, hidden, or displayed as read-only.

Defining the Token URL – oAuth v2 password grant

In the Token URL field, optionally define a URL that can be used to test the authentication settings from Bot Builder before you deploy the task with the authorization mechanism. You can use dynamic fields, path parameter fields, query fields, and so forth, to define the test URL, for example,

http://{tenant}.someCompany.com/test/{{tokenId}}

In the Token URL Method field, select the HTTP request method type for the Token URL. One of PUT, POST, PATCH, DELETE, and GET.

In the Token URL Content Type field, select the content type expected from the Token URL. One of: JSON, RSS, XML, URL Encoded JSON, CSV, Text, Twitter Encoded JSON, Multipart/Form-data,Multipart/Related, or Oracle ADF.

In the Access Using a Connector section, select Yes to enable access for Kore.ai Bots using the Kore.ai Connector agent. If your domain does not have any active Kore.ai Connectors defined, a warning message is displayed to contact the Bots Admin Console system administrator. For more information, see Using the Kore.ai Connector in the Bots Admin Console documentation.

Click Save Auth to save the authorization settings and close the New Authorization Mechanism dialog.

Testing the Authorization – oAuth v2 password grant

After you save the authentication, if you defined an Authorization URL for your new authorization type, you can test your authorization definition on the Authentication page when you click Test Authorization before continuing to develop the remain steps of your task.

Test Authorization

When you click Test Authorization, the Test Authorization dialog is displayed and populated with the URL you specified in the Authorization Check URL section, as shown in the following illustration.

Test Authorization Dialog - OAuth V2 Password Grant

Click Test to begin the authorization test. When the validation of authentication is complete, the Test Authorization dialog is closed and the results of the validation, either success or failed, is displayed to the immediate right of the Test Authorization button. If the authorization fails, the Auth Test Failed message is displayed along with the Headers and Response tabs as shown in the following illustration.

Authentication Test Fail

Setting Up Authorization using OAuth v1

OAuth is an open protocol to allow secure authorization in a simple and standard method from web, mobile, and desktop applications.

To use OAuth, you must first register an account with the web application as you will need the log on credentials for that application to configure the settings for the authorization mechanism.

How OAuth v1 Works

  1. The Kore.ai application obtains an unauthorized request token from the web application.
  2. The Kore.ai application redirects the user to a login dialog at the web application.
  3. The user authorizes the request token, associating it with their account.
  4. The web application redirects the user back to the Kore.ai application.
  5. The Kore.ai application exchanges the request token for an access token.
  6. The access token allows the Kore.ai application to access a protected resource at the provider, on behalf of the user.

The following illustration is an example of the oAuth v1 authorization type fields that you must define to enable a customized authorization for your task.

New Authorization Mechanism - oAuth V1

To define oAuth v1, define the fields described in the following table.

FIELD NAME DESCRIPTION
Authorization Type Set to oAuth v1.
Bots Callback Link The URL used by the web application or web service to redirect the end-user after end-user authorization is complete. This value, https://idp.kore.ai/workflows/callback/,  is provided as a read-only value by the Kore.ai application when you define oAuth v1 settings.
Identity Provider Name The name of the web application or web service, for example, Twitter. This field is required.
Request Token Link The URL used by the Kore.ai application to obtain an unauthorized request token. A request token is the value used by the Kore.ai application to obtain authorization from the end-user to obtain an access token. For example, https://{tenant}.someCompany.com/oauth/request_token. After end-user authorization, an access token can be requested by the Kore.ai application. This field is required.
Access Token Link The URL used to exchange the end-user authorized request token for an access token. The access token is the value used by the Kore.ai application to gain access to the web application or web service on behalf of the end-user, instead of using the end-users log on credentials. For example, https://{tenant}.someCompany.com/oauth/access_token. This field is required.
User Authorization Link The URL used to obtain end-user authorization for the Kore.ai application to access the web application or web service using the access token. For example, https://{tenant}.someCompany.com/oauth/authorize. This field is required.
Access Using a Connector Select Yes to enable access for Kore.ai Bots using the Kore.ai Connector agent. This option is only visible if a Kore.ai Connector agent is configured and enabled in your enterprise on-premises network. For more information, see Using the Kore.ai Connector.
Consumer Key The value provided as the Kore.ai application identification to the web application. This field is required.
Consumer Secret The secret value provided by the Kore.ai application to establish ownership of the Consumer Key. This field is required.

 

Defining Tenancy

If required, in the Subdomain section, select Yes if the base URL for a web application or user interface the uses a tenant name in the URL. For example, kore is the tenant organization for a web service using tenants as www.kore.someCompany.com.

In the following example configuration, the tenancy URL contains the {tenant} organization placeholder.

Task Subdomain Section

Adding Additional Fields

Click + Add Additional Fields to open the Additional Fields dialog, and then enter one or more key/value pairs that represent additional authorization input fields, if required as shown in the following illustration.

Additional Authorization Fields

Specify the following fields:

  • Field Key – The name of the custom field to specify for authorization.
  • Value – The value of the custom field to specify for the authorization.

Click Add to save the Additional Field.

To add more Additional Fields, click Add in the Additional Fields section.

Adding Authorization Fields

By default, authorization fields are configured as part of the header of the task request message. If your task request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click + Add Authorization Field and then define the fields as shown in the following illustration.

Authorization Fields for Basic Auth

In the Field Type field, you can select one of the following depending on where in the task request message and the type of authorization fields that are required.

  • Header – The Bot expects the authorization fields as part of the header of the request.
  • Payload – The Bot expects the authorization fields as part of the content of the body of the request.
  • Query String – The Bot expects the authorization fields as a query in the body of the request.
  • Path Param – The Bot expects the authorization fields as part of the URL path for the request.

In the Field Key field, enter the name of the field for the selected Field Type.

In the Field Value field, enter the value for the Field Key specified.

Click Add. The new authorization field is added in the Authorization Fields section.

To add additional authorization fields, click Add in the Authorization Fields section.

Testing the Authorization – oAuth v1

After you save the authentication, you can test your authorization definition on the Authentication page when you click Test Authorization before continuing to develop the remain steps of your task.

Test Authorization

When you click Test Authorization, the test is executed using the authentication token URLs and the Consumer Key and Consumer Token. If tenancy was defined, the Test Authorization dialog is displayed as shown in the following illustration.

Test Authorization Dialog - oAuth
Click Test to begin the authorization test. When the validation of authentication is complete, the Test Authorization dialog is closed and the results of the validation, either success or failed, is displayed to the immediate right of the Test Authorization button. If the authorization fails, the Auth Test Failed message is displayed along with the Headers and Response tabs as shown in the following illustration.

Authentication Test Fail

Setting Up Authorization using OAuth v2

OAuth v2 is the new version of the open protocol to allow secure authorization in a simple and standard method from web, mobile, and desktop applications.

To use oAuth v2, you must first register an account with the web application as you will need the log on credentials for that application to configure the settings for the Authorization Mechanism.

How oAuth v2 Works

  1. The Kore.ai application redirects the user to a login dialog at the web application.
  2. The user authenticates.
  3. The web application redirects the user back to the Kore.ai application with an access token.
  4. The Kore.ai application validates the access token.
  5. The access token allows the Kore.ai application to access a protected resource at the provider, on behalf of the user.

The following illustration shows the fields to define for the oAuth v2 Authorization Type.

oAuth v2 Dialog

To configure oAuth v2, define the fields described in the following table.

FIELD NAME DESCRIPTION
Authorization Type Set to oAuth v2.
Bots Callback Link The URL used by the web application or web service to redirect the end-user after end-user authorization is complete. This value, https://idp.kore.ai/workflows/callback/ is provided as a read-only value by the Kore.ai application when you define oAuth v2 settings.
Identity Provider Name The name of the web application or web service, for example, Asana. This field is required.
Client ID The ID of the Kore.ai client.
Client Secret Key The value provided as the Kore.ai application authentication based on the Client ID to the web application.
Authorization URL The URL used to obtain end-user authorization for the Kore.ai application to access the web application or web service using the access token. This field is required.
Access Using a Connector Select Yes to enable access for Kore.ai Bots using the Kore.ai Connector agent. This option is only visible if a Kore.ai Connector agent is configured and enabled in your enterprise on-premises network. For more information, see Using the Kore.ai Connector.
Token Request URL The URL used by the Kore.ai application to obtain an unauthorized request token. A request token is the value used by the Kore.ai application to obtain authorization from the end-user to obtain an access token. After end-user authorization, an access token can be requested by the Kore.ai application. This field is required.
Scope If the Bot web service requires additional values for authorization, add one or more Key/Value pairs. For example, some Bot web services support using a scope key using read-only, write, or both as the value.

Defining Tenancy

If required, in the Subdomain section, select Yes if the base URL for a web application or user interface the uses a tenant name in the URL. For example, kore is the tenant organization for a web service using tenants as www.kore.someCompany.com.

In the following example configuration, the tenancy URL contains the {tenant} organization placeholder.

Task Subdomain Section

Adding Additional Fields

Click + Add Additional Fields to open the Additional Fields dialog, and then enter one or more key/value pairs that represent additional authorization input fields, if required as shown in the following illustration.

Additional Authorization Fields

Specify the following fields:

  • Field Key – The name of the custom field to specify for authorization.
  • Value – The value of the custom field to specify for the authorization.

Click Add to save the Additional Field.

To add more Additional Fields, click Add in the Additional Fields section.

Adding Authorization Fields

By default, authorization fields are configured as part of the header of the task request message. If your task request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click + Add Authorization Field and then define the fields as shown in the following illustration.

Authorization Fields for Basic Auth

In the Field Type field, you can select one of the following depending on where in the task request message and the type of authorization fields that are required.

  • Header – The Bot expects the authorization fields as part of the header of the request.
  • Payload – The Bot expects the authorization fields as part of the content of the body of the request.
  • Query String – The Bot expects the authorization fields as a query in the body of the request.
  • Path Param – The Bot expects the authorization fields as part of the URL path for the request.

In the Field Key field, enter the name of the field for the selected Field Type.

In the Field Value field, enter the value for the Field Key specified.

Click Add. The new authorization field is added in the Authorization Fields section.

To add additional authorization fields, click Add in the Authorization Fields section.

Testing the Authorization – oAuth v2

After you save the authentication, you can test your authorization definition on the Authentication page when you click Test Authorization before continuing to develop the remain steps of your task.

Test Authorization

When you click Test Authorization, the test is executed using the authentication token URLs and the Client ID and Client Secret Key. If tenancy was defined, the Test Authorization dialog is displayed as shown in the following illustration.


Click Test to begin the authorization test. When the validation of authentication is complete, the Test Authorization dialog is closed and the results of the validation, either success or failed, is displayed to the immediate right of the Test Authorization button. If the authorization fails, the Auth Test Failed message is displayed along with the Headers and Response tabs as shown in the following illustration.

Authentication Test Fail

Setting Up Authorization using an API Key

An API key can act as both a unique identifier and a secret token for identification as well as authentication to provide a set of access rights on the associated API. Instead of prompting the end-user for both a username and password for access, the user is prompted only for an API key when configuring the task.

To use the API Key Authorization Type, you must first register an account with the web application and then generate an API Key for that application to configure the settings for the Kore.ai authorization mechanism.

The following illustration shows the fields to define for the API Key Authorization Type.

Authorization Tab - API Key DialogTo define an API key authorization, select API Key in the Authorization Type field. Then specify a Name for the authorization to be displayed in the Bot builder user interface.

Defining Tenancy

If required, in the Subdomain section, select Yes if the base URL for a web application or user interface the uses a tenant name in the URL. For example, kore is the tenant organization for a web service using tenants as www.kore.someCompany.com.

In the following example configuration, the tenancy URL contains the {tenant} organization placeholder.

Adding Authorization Fields

By default, authorization fields are configured as part of the header of the task request message. If your task request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click + Add Authorization Field and then define the fields as shown in the following illustration.

In the Field Type field, you can select one of the following depending on where in the task request message and the type of authorization fields that are required.

  • Header – The Bot expects the authorization fields as part of the header of the request.
  • Payload – The Bot expects the authorization fields as part of the content of the body of the request.
  • Query String – The Bot expects the authorization fields as a query in the body of the request.
  • Path Param – The Bot expects the authorization fields as part of the URL path for the request.

In the Field Key field, enter the name of the field for the selected Field Type.

In the Field Value field, enter the value for the Field Key specified.

Click Add. The new authorization field is added in the Authorization Fields section.

To add additional authorization fields, click Add in the Authorization Fields section.

Adding Form Fields to the Authorization Form

If the default username and password fields do not meet your needs, you can add new fields displayed to the end-user by adding authorization form fields. To add fields on the authorization form, click + Add Form Field. The following illustration is an example of a definition to add a password field to the authorization dialog.

The following table describes the fields used to define an authorization IDP form field.

FIELD NAME DESCRIPTION
Title of Field Specify the name of the field displayed to the end-user in the authentication dialog.
Field Key The value represents the end-user input value to the authenticating service.
Help Hint The help text displayed in the field to describe what should be entered into the field.
Field Type When Advanced Options is selected, specify the type of field displayed in the end-user interface to collect the user input assigned as the value for the Field Key, one of:

  • Textbox
  • Password
Mandatory When Advanced Options is selected, select if the end-user must define this field to complete authentication.
Data Type When Advanced Options is selected, specify the type of data expected as input from the end-user, for example, String.
Visibility When Advanced Options is selected, specify if the authentication field should be visible, hidden, or displayed as read-only.

Testing the Authorization – API Key

After you save the authentication, if you defined an Authorization Check URL for your new authorization type, you can test your authorization definition on the Authentication tab when you click Test Authorization before continuing to develop the remain steps of your task.

Test Authorization

When you click Test Authorization, the Test Authorization dialog is displayed and populated with the URL you specified in the Authorization Check URL section, as shown in the following illustration.

Test Authorization - API Key

To configure the Test Authorization – API Key

  1. In the Auth Check URL field, verify or enter the URL to test the authentication configuration.
  2. If your bot uses subdomains, the Tenancy field is displayed and you must specify the tenant.
  3. Enter the API key for the application in the API Key field.
  4. Select the content type expected for the URL in the Content-Type field.
  5. For testing the URL, the Method field is read-only and set to GET.
  6. Click Test to begin the authorization test.

When the validation of authentication is complete, the Test Authorization dialog is closed and the results of the validation, either success or failed, is displayed to the immediate right of the Test Authorization button. If the authorization fails, the Auth Test Failed message is displayed along with the Headers and Response tabs as shown in the following illustration.

Authentication Test Fail

Next Steps

After you define the authorization mechanism, and then click Save Auth, you are ready to configure the action task request. The configuration settings for an action task request object are based on the Connection Type that you define for the action task. For more information, see:

Was this article helpful to you? Yes No