{"id":17945,"date":"2016-12-05T21:42:16","date_gmt":"2016-12-05T21:42:16","guid":{"rendered":"https:\/\/developer.kore.com\/?post_type=docs&#038;p=9108"},"modified":"2021-03-18T10:12:28","modified_gmt":"2021-03-18T10:12:28","slug":"setting-up-authorization-using-basic-auth","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-basic-auth\/","title":{"rendered":"Setting Up Authorization using 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 class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To define Basic Authorization for your bot, follow these steps:<\/p>\n<ol>\n<li>Open the bot for which you want to configure a Basic Authorization profile.<\/li>\n<li>Hover over the left-side navigation panel and from <strong>Settings -&gt; Config Settings<\/strong> select <strong>Authorization Profile<\/strong><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/auth-profiles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21924\" src=\"\/wp-content\/uploads\/sites\/18\/auth-profiles.png\" alt=\"\" width=\"349\" height=\"569\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/18\/20221201101820\/auth-profiles.png 349w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/wp-content\/uploads\/sites\/18\/20221201101820\/auth-profiles-184x300.png 184w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/a><\/li>\n<li>Click<strong> Add<\/strong>.\u00a0The <strong>New Authorization Mechanism<\/strong> dialog opens.<\/li>\n<li>In the <strong>Authorization Type<\/strong> drop-down list, select\u00a0<strong>Basic Auth<\/strong>.<\/li>\n<li>In the <strong>Name<\/strong> field, enter the name for your <strong>Basic Auth<\/strong> type.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Basic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14700 alignnone\" src=\"\/wp-content\/uploads\/sites\/18\/Basic.png\" alt=\"\" width=\"496\" height=\"281\" \/><\/a><\/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<h3><span class=\"ez-toc-section\" id=\"Defining_Tenancy\">Defining Tenancy<\/span><\/h3>\n<p>If\u00a0required, in the\u00a0<strong>Subdomain<\/strong>\u00a0section, select <strong>Yes<\/strong>\u00a0if the base URL for a web application or user interface uses a\u00a0tenant name in the URL. For example,\u00a0<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><\/p>\n<p>In the following example configuration, the tenancy URL contains the <span style=\"color: #0000ff\">{tenant}<\/span> organization placeholder.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Tenacy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14701 alignnone\" src=\"\/wp-content\/uploads\/sites\/18\/Tenacy.png\" alt=\"\" width=\"566\" height=\"170\" \/><\/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<h3><span class=\"ez-toc-section\" id=\"Adding_Form_Fields\"><span class=\"wysiwyg-font-size-large\">Adding Form Fields\u00a0<\/span><\/span><\/h3>\n<p>If the default username and password fields do not meet your needs for authorization input, you can add custom fields displayed to the end-user by adding authorization IDP form fields. You can use these form fields. For example, if PIN code is required in the authorization process, in addition to the <strong>Username<\/strong> and <strong>Password<\/strong> form fields.<br \/>\n<a name=\"form\"><\/a><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Form-Fields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14704 alignnone\" src=\"\/wp-content\/uploads\/sites\/18\/Form-Fields.png\" alt=\"\" width=\"443\" height=\"439\" \/><\/a><br \/>\nThe 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\" scope=\"col\">FIELD NAME<\/th>\n<th class=\"wysiwyg-text-align-left\">DESCRIPTION<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Field Title<\/td>\n<td>Specify the name of the field displayed to the end-user in the authorization dialog.<\/td>\n<\/tr>\n<tr>\n<td>Field Key<\/td>\n<td>The value that represents the end-user input value to the authorizing 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 the authorization.<\/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 authorization 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<h3><span class=\"ez-toc-section\" id=\"Adding_Authorization_Fields\"><span class=\"wysiwyg-font-size-large\">Adding Authorization Fields<\/span><\/span><\/h3>\n<p>By default, authorization fields are configured as part of the header of the Bot\u00a0request message. If your Bot\u00a0request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN, click <strong>Add<\/strong>\u00a0in the <strong>Authorization Fields<\/strong> section and then define the required fields.<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Authorization-fields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14703 alignnone\" src=\"\/wp-content\/uploads\/sites\/18\/Authorization-fields.png\" alt=\"\" width=\"500\" height=\"208\" \/><\/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 Bot\u00a0request message and the type of authorization fields that are required.\n<ul>\n<li><strong>Header<\/strong> &#8211;\u00a0The bot\u00a0looks for the authorization fields in the request header.<\/li>\n<li><strong>Payload<\/strong> &#8211; The bot looks for the authorization fields in the request body content.<\/li>\n<li><strong>Query String<\/strong> &#8211;\u00a0The bot looks for the authorization fields as a query in the request body.<\/li>\n<li><strong>Path Param<\/strong> &#8211; The book looks for the authorization fields in the request URL path.<\/li>\n<\/ul>\n<\/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,\u00a0enter the value for the <strong>Field Key<\/strong> specified.<\/li>\n<li>Click <strong>Add<\/strong>. The new authorization field is added in the <strong>Authorization Fields<\/strong> section.<\/li>\n<\/ol>\n<p>To add additional authorization fields, click <strong>Add<\/strong>\u00a0in the <strong>Authorization\u00a0Fields<\/strong> section.<\/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<h3><span class=\"ez-toc-section\" id=\"Authorization_Check_URL\">Authorization Check URL<\/span><\/h3>\n<p>In the <strong>Authorization Check URL<\/strong> field, optionally define a URL that can be used to test the authorization settings from Bot Builder before you deploy the Bot with the authorization mechanism. You can use dynamic fields, path parameter fields, query fields, and so forth, to define the test URL.<\/p>\n<p>For example<\/p>\n<p><span style=\"color: #0000ff\">https:\/\/kore.someCompany.com\/sap\/opu\/odata\/sap\/{{authfield1}}\/?$format=json<\/span><br \/>\nor<br \/>\n<span style=\"color: #0000ff\">https:\/\/{tenant}.service-now.com\/api\/now\/v1\/table\/incident<\/span><br \/>\nFor more information, see <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/using-session-and-context-variables-in-tasks\/\">Using Session and Context Variables in Tasks<\/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<h3><span class=\"ez-toc-section\" id=\"Access_Using_a_Connector\">Access Using a Connector<\/span><\/h3>\n<p>In the <strong>Access Using a Connector<\/strong> section, select <strong>Yes<\/strong> to enable access for Kore.ai Bots using the Kore.ai Connector Agent.<\/p>\n<p>The Kore.ai Connector Agent can be used to establish and maintain secure data connectivity between cloud-based Kore.ai Bots and your on-premises Bots application. Using an on-premise Bots application, communications security is maintained by restricting users and systems within the company intranet or by configuring specific channels for specific data exchange.<\/p>\n<p>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 <a href=\"\/v8-1\/docs\/bots\/admin-console\/security-control\/security-module-overview\/#Why_Use_the_Koreai_Connector_for_Bots\">Using the Kore.ai Connector<\/a> in the Bots Admin Console documentation.<\/p>\n<p>Click <strong>Save<\/strong>\u00a0to save the authorization settings and close the <strong>New Authorization Mechanism<\/strong> dialog.<\/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<h3><span class=\"ez-toc-section\" id=\"Testing_the_Authorization\"><span class=\"wysiwyg-font-size-large\">Testing the Authorization\u00a0<\/span><\/span><\/h3>\n<p>Once you save the authorization settings, you can test your authorization definition when you click <strong>Test <\/strong>from the Authorization Profile page.<\/p>\n<p>When you\u00a0click <strong>Test<\/strong>, the <strong>Test Authorization<\/strong> dialog.<\/p>\n<p>&nbsp;<\/p>\n<p><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/test-authorization.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14707 alignnone\" src=\"\/wp-content\/uploads\/sites\/18\/test-authorization.png\" alt=\"\" width=\"304\" height=\"423\" \/><\/a><\/p>\n<p><strong>To configure the Test Authorization &#8211; Basic Auth<\/strong><\/p>\n<ol>\n<li>In the <strong>Auth Check URL<\/strong> field, verify or enter the URL to test the authorization configuration.<\/li>\n<li>If your bot 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>\u00a0field 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 authorization is complete, the <strong>Test Authorization<\/strong> dialog closes and you can see the results of the validation, either success or failure, on the top-right corner of the screen.<\/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.<\/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<h3><span class=\"ez-toc-section\" id=\"How_it_all_Works\"><span class=\"wysiwyg-font-size-large\">How it all Works\u00a0<\/span><\/span><\/h3>\n<p>When basic authorization is used for a Bot, the Kore.ai application automatically prompts the user for login credentials to access the web application or web service as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/DIYBasicAuthRequest-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2218 size-full\" src=\"\/wp-content\/uploads\/sites\/18\/DIYBasicAuthRequest-1.png\" alt=\"DIYBasicAuthRequest\" width=\"1130\" height=\"556\" \/><\/a><\/p>\n<p>After the end-user authorizes, the settings are saved using the following naming syntax:<\/p>\n<pre class=\"\">{{ First Name }} {{ Last Name }} {{ Bot Name }} {{ Account # }} {{ Sequence # }}<\/pre>\n<p>For example, <span style=\"color: #0000ff\">John Smith&#8217;s Twitter Account #1<\/span>.<\/p>\n<p>The Kore.ai application can access the web application or web service for all future Bot\u00a0requests using this account. In addition, the end-user can reuse the account for other tasks for\u00a0the same Bot.<\/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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To define Basic Authorization for your bot, follow these steps: Open the bot for which you want to configure a Basic Authorization profile. Hover over the left-side navigation panel and from Settings -&gt; Config Settings select Authorization Profile Click Add.\u00a0The New Authorization Mechanism dialog opens. In the Authorization Type drop-down list, select\u00a0Basic Auth. In the...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-17945","post","type-post","status-publish","format-standard","hentry","category-authorization"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/17945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=17945"}],"version-history":[{"count":6,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/17945\/revisions"}],"predecessor-version":[{"id":27093,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/17945\/revisions\/27093"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=17945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=17945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=17945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}