{"id":27038,"date":"2021-03-17T05:50:33","date_gmt":"2021-03-17T05:50:33","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=27038"},"modified":"2022-09-27T15:44:23","modified_gmt":"2022-09-27T14:44:23","slug":"alert-task-basic-auth","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/alert\/alert-task-basic-auth\/","title":{"rendered":"Alert Task &#8211; Basic Auth"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><\/div><\/div><\/section><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><\/div><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>We have seen how an Alert task can be set up in Kore.ai virtual assistant platform <a href=\"\/docs\/bots\/bot-builder-tool\/alert\/notification-tasks\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. In this section, we will see how basic authorization for the alert tasks can be set up.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h1><span class=\"ez-toc-section\" id=\"How_it_Works\"><span style=\"font-weight: 400\">How it Works&nbsp;<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">When basic authorization is used for a task, the XO Platform automatically prompts the user for login credentials to access the web application or web service, as shown in the following illustration.<\/span><\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152327\/DIYBasicAuthRequest-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-45742\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152327\/DIYBasicAuthRequest-1-1-1024x504.png\" alt=\"\" width=\"640\" height=\"315\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152327\/DIYBasicAuthRequest-1-1-1024x504.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152327\/DIYBasicAuthRequest-1-1-300x148.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152327\/DIYBasicAuthRequest-1-1.png 1130w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">After the end-user is authorized, the settings are saved using the following naming syntax:<\/span><\/p>\n<p><span style=\"font-weight: 400\">{{ First Name }} {{ Last Name }} {{ VA Name }} {{ Account # }} {{ Sequence # }}<\/span><\/p>\n<p><span style=\"font-weight: 400\">For example, <\/span><span style=\"font-weight: 400\">John Smith&rsquo;s Twitter Account #1<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The XO Platform 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 Virtual Assistant.<\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"General_Setup\"><span style=\"font-weight: 400\">General Setup&nbsp;<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">You can use Basic Authorization when configuring API Requests within Alert Tasks. To configure authorization using Basic Authorization:<\/span><\/p>\n<ol>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Select the <\/span><strong>VA <\/strong><span style=\"font-weight: 400\">you want to work with.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go to <\/span><strong>Build &gt; Conversation Skills &gt; Alert Tasks<\/strong><span style=\"font-weight: 400\">.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Select the <\/span><strong>task <\/strong><span style=\"font-weight: 400\">you want to work with.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click the <\/span><strong>API Request<\/strong><span style=\"font-weight: 400\"> tab within the Alert Task.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Expand the <\/span><strong>Authorization <\/strong><span style=\"font-weight: 400\">section and click <\/span><strong>Create New<\/strong><span style=\"font-weight: 400\"> to configure a new authorization.<\/span><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152512\/new-auth.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-45745\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152512\/new-auth-1024x426.png\" alt=\"\" width=\"640\" height=\"266\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152512\/new-auth-1024x426.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152512\/new-auth-300x125.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152512\/new-auth.png 1145w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Next, the <\/span><strong>New Authorization Mechanism<\/strong><span style=\"font-weight: 400\"> window opens, as shown in the illustration below. <\/span><br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152609\/basic-auth-config.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-45748\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152609\/basic-auth-config-662x1024.png\" alt=\"\" width=\"440\" height=\"590\" \/><\/a><\/li>\n<\/ol>\n<\/ol>\n<p><span style=\"font-weight: 400\">To define Basic Authorization, select <\/span><strong>Basic Auth<\/strong><span style=\"font-weight: 400\"> in the <\/span><strong>Authorization Type<\/strong><span style=\"font-weight: 400\"> field. Then specify a <\/span><strong>Name<\/strong><span style=\"font-weight: 400\"> for the authorization to be displayed in the XO Platform&nbsp; user interface. Next, please make your configuration according to the steps below.<\/span><\/p>\n<h1><span class=\"ez-toc-section\" id=\"Tenancy\"><span style=\"font-weight: 400\">Tenancy<\/span><\/span><\/h1>\n<p>If&nbsp;required, in the&nbsp;<strong>Subdomain<\/strong>&nbsp;section, select <strong>Yes<\/strong> if the base URL for a web application or user interface uses a&nbsp;tenant name in the URL. For example,&nbsp;<span style=\"color: #0000ff\">kore<\/span> is the tenant organization for a web service using tenants as <span style=\"color: #0000ff\">www.<strong><em>kore<\/em><\/strong>.someCompany.com.<\/span> In the following example configuration, the tenancy URL contains the <span style=\"color: #0000ff\">{tenant}<\/span> organization placeholder.<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152832\/tenancy.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-45751\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152832\/tenancy.png\" alt=\"\" width=\"718\" height=\"q21\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152832\/tenancy.png 818w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152832\/tenancy-300x81.png 300w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h1><span class=\"ez-toc-section\" id=\"Form_Fields\"><span style=\"font-weight: 400\">Form Fields<\/span><\/span><\/h1>\n<p>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 <strong>+&nbsp;Add&nbsp;Form Field<\/strong>. The following illustration is an example of a definition to add a password field to the authorization dialog.<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152955\/form-fields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-45754\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927152955\/form-fields-791x1024.png\" alt=\"\" width=\"340\" height=\"529\" \/><\/a><\/p>\n<p>The following table describes the fields used to define an authorization IDP form field.<\/p>\n<table>\n<thead>\n<tr>\n<th class=\"wysiwyg-text-align-left\" style=\"text-align: center\" scope=\"col\">FIELD NAME<\/th>\n<th class=\"wysiwyg-text-align-left\" style=\"text-align: center\">DESCRIPTION<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Field Title<\/td>\n<td>Specify the name of the field&nbsp;displayed to the end-user in the authentication dialog.<\/td>\n<\/tr>\n<tr>\n<td>Field Key<\/td>\n<td>The value represents the end-user input value to the authenticating service.<\/td>\n<\/tr>\n<tr>\n<td>Help Hint<\/td>\n<td>The help text displayed in the field to describe what should be entered into the field.<\/td>\n<\/tr>\n<tr>\n<td>Field Type<\/td>\n<td>When <strong>Advanced Options<\/strong> is selected, specify the type of field displayed in the end-user interface to collect the user input assigned as the value for the <strong>Field Key<\/strong>, one of:<\/p>\n<ul>\n<li><strong>Textbox<\/strong><\/li>\n<li><strong>Password<\/strong><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Mandatory<\/td>\n<td>When <strong>Advanced Options<\/strong> is selected, select if the end-user must define this field to complete authentication.<\/td>\n<\/tr>\n<tr>\n<td>Data Type<\/td>\n<td>When <strong>Advanced Options<\/strong> is selected, specify the type of data expected as input from the end-user. For example, <strong>String<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>Visibility<\/td>\n<td>When <strong>Advanced Options<\/strong> is selected, specify if the authentication field should be visible, hidden, or displayed as read-only.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h1><span class=\"ez-toc-section\" id=\"Authorization_Fields\"><span style=\"font-weight: 400\">Authorization Fields<\/span><\/span><\/h1>\n<p>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, a verification code, click<strong>+ Add Authorization Field&nbsp;<\/strong>and then define the fields as shown in the following illustration.&nbsp;<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153112\/auth-fields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-45757\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153112\/auth-fields.png\" alt=\"\" width=\"520\" height=\"186\" \/><\/a><\/p>\n<ol>\n<li>In the <strong>Field Type<\/strong> field, you can select one of the following depending on where in the task&nbsp;request message and the type of authorization fields that are required. <strong>Header<\/strong> &#8211; The VA expects the authorization fields as part of the header of the request.<strong>Payload<\/strong> &#8211; The assistant expects the authorization fields as part of the content of the body of the request. <strong>Query String<\/strong> &#8211; The VA expects the authorization fields as a query in the body of the request. <strong>Path Param<\/strong> &#8211; The VA expects the authorization fields as part of the URL path for the request.<\/li>\n<li>In the <strong>Field Key<\/strong> field, enter the name of the field for the selected <strong>Field Type<\/strong>.<\/li>\n<li>In the <strong>Field Value<\/strong> field,&nbsp;enter the value for the <strong>Field Key<\/strong> specified.<\/li>\n<li>Click <strong>Done<\/strong>. The new authorization field is added in the <strong>Authorization Fields<\/strong> section.<\/li>\n<li>To add additional authorization fields, click <strong>Add<\/strong>&nbsp;in the <strong>Authorization&nbsp;Fields<\/strong> section.<\/li>\n<li>In the <strong>Authorization Check URL<\/strong> field, optionally define a URL that is used to test the authentication settings from the XO Platform 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<\/li>\n<li>Click <strong>Save<\/strong>&nbsp;to save the authorization settings and close the <strong>New Authorization Mechanism<\/strong> dialog.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h1><span class=\"ez-toc-section\" id=\"Testing\"><span style=\"font-weight: 400\">Testing<\/span><\/span><\/h1>\n<p>After you save the authentication, if you have defined an <strong>Authorization Check URL<\/strong> for your new authorization type, you can test your authorization definition on the <strong>Authorization <\/strong>tab.<\/p>\n<ol>\n<li>Click <strong>Test Authorization<\/strong> before continuing to develop the remaining steps of your task.<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153325\/test-authorization-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-45760\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153325\/test-authorization-1.png\" alt=\"\" width=\"877\" height=\"113\" \/><\/a><\/li>\n<li>After you click <strong>Test Authorization<\/strong>, the <strong>Test Authorization<\/strong> window is displayed and populated with the URL you specified in the <strong>Authorization Check URL<\/strong> section, as shown in the following illustration.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-45763\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153602\/testing-window.png\" alt=\"\" width=\"302\" height=\"250\" \/><\/li>\n<\/ol>\n<p>&nbsp; To configure the Test Authorization &#8211; Basic Auth, follow the below steps:<\/p>\n<ol>\n<li>In the <strong>Auth Check URL<\/strong> field, verify or enter the URL to test the authentication configuration.<\/li>\n<li>If your assistant uses subdomains, the <strong>Tenancy<\/strong> field is displayed and you must specify the tenant.<\/li>\n<li>Enter your <strong>User Name<\/strong> and <strong>Password<\/strong> for the web service.<\/li>\n<li>Select the content type expected for the URL in the <strong>Content-Type<\/strong> field.<\/li>\n<li>For testing the URL, the <strong>Method<\/strong>&nbsp;field is read-only and set to <strong>GET<\/strong>.<\/li>\n<li>Click <strong>Test<\/strong> to begin the authorization test.<\/li>\n<\/ol>\n<p>When the validation of authentication is complete, the <strong>Test Authorization<\/strong> window is closed and the results of the validation, either success or failure, is displayed to the immediate right of the <strong>Test Authorization<\/strong> button as shown in the following illustration.&nbsp;<\/p>\n<p>If the authorization fails, the <em>Auth Test Failed<\/em> message is displayed along with the <strong>Headers<\/strong> and <strong>Response<\/strong> tabs as shown in the following illustration.<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153714\/failure.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-45766\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220927153714\/failure.png\" alt=\"\" width=\"478\" height=\"309\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div>\r\n\n","protected":false},"excerpt":{"rendered":"We have seen how an Alert task can be set up in Kore.ai virtual assistant platform here. In this section, we will see how basic authorization for the alert tasks can be set up. How it Works&nbsp; When basic authorization is used for a task, the XO Platform automatically prompts the user for login credentials...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-27038","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/27038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=27038"}],"version-history":[{"count":4,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/27038\/revisions"}],"predecessor-version":[{"id":45741,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/27038\/revisions\/45741"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=27038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=27038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=27038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}