{"id":27042,"date":"2021-03-17T05:53:50","date_gmt":"2021-03-17T05:53:50","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-1\/?p=27042"},"modified":"2021-03-17T05:58:02","modified_gmt":"2021-03-17T05:58:02","slug":"alert-task-oauth-v1","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-1\/docs\/bots\/bot-builder-tool\/alert\/alert-task-oauth-v1\/","title":{"rendered":"Alert Task \u2013 OAuth v1"},"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>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 authorization for the alert tasks can be set up using the OAuth v1.<\/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<h2><span class=\"ez-toc-section\" id=\"Setting_Up\">Setting Up<\/span><\/h2>\n<p>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-in credentials for that application to configure the settings for the authorization mechanism.<\/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<h2><span class=\"ez-toc-section\" id=\"Tenancy\">Tenancy<\/span><\/h2>\n<p>If\u00a0required, in the\u00a0<strong>Subdomain<\/strong>\u00a0section, select <strong>Yes<\/strong> if 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><br \/>\nIn 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\/22\/DIYTaskSubdomain-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17135\" src=\"\/wp-content\/uploads\/sites\/22\/DIYTaskSubdomain-1.png\" alt=\"\" width=\"650\" height=\"189\" \/><\/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<h2><span class=\"ez-toc-section\" id=\"Form_Fields\"><span class=\"wysiwyg-font-size-large\">Form Fields<\/span><\/span><\/h2>\n<p>To define oAuth v1, define the fields described in the following table.<\/p>\n<table width=\"474\">\n<thead>\n<tr>\n<th class=\"wysiwyg-text-align-left\">FIELD NAME<\/th>\n<th class=\"wysiwyg-text-align-left\">DESCRIPTION<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Authorization Type<\/td>\n<td>Set to oAuth v1.<\/td>\n<\/tr>\n<tr>\n<td>Callback URL<\/td>\n<td>The URL used by the web application or web service to redirect the end-user after end-user authorization is complete. This value, <span style=\"color: #0000ff;\">https:\/\/idp.kore.ai\/workflows\/callback\/<\/span>, \u00a0is provided as a read-only value by the Kore.ai application when you define oAuth v1 settings.<\/td>\n<\/tr>\n<tr>\n<td>Identity Provider Name<\/td>\n<td>The name of the web application or web service, for example, <em>Twitter<\/em>. This field is required.<\/td>\n<\/tr>\n<tr>\n<td>Consumer Key<\/td>\n<td>The value provided as the Kore.ai application\u00a0identification to the web application.\u00a0This field is required.<\/td>\n<\/tr>\n<tr>\n<td>Consumer Secret<\/td>\n<td>The secret value\u00a0provided by the Kore.ai application\u00a0to establish ownership of the <strong>Consumer Key<\/strong>.\u00a0This field is required.<\/td>\n<\/tr>\n<tr>\n<td>Request Token Link<\/td>\n<td>The URL used by the Kore.ai application to obtain an unauthorized request token. A request token is the\u00a0value used by the Kore.ai application\u00a0to obtain authorization from the end-user to obtain an access token. For example, <span style=\"color: #0000ff;\">https:\/\/{tenant}.someCompany.com\/oauth\/request_token<\/span>. After end-user authorization, an access token can be requested by the Kore.ai application.\u00a0This field is required.<\/td>\n<\/tr>\n<tr>\n<td>Access Token Link<\/td>\n<td>The URL used to exchange the end-user\u00a0authorized request token for an access token. The access token is the\u00a0value used by the Kore.ai application\u00a0to gain access to the web application or web service\u00a0on behalf of the end-user, instead of using the end-users log on credentials. For example, <span style=\"color: #0000ff;\">https:\/\/{tenant}.someCompany.com\/oauth\/access_token<\/span>. This field is required.<\/td>\n<\/tr>\n<tr>\n<td>User Authorization Link<\/td>\n<td>The URL used to obtain end-user\u00a0authorization for the Kore.ai application to access the web application or web service using the access token. For example, <span style=\"color: #0000ff;\">https:\/\/{tenant}.someCompany.com\/oauth\/authorize<\/span>. This field is required.<\/td>\n<\/tr>\n<tr>\n<td>Access Using a Connector<\/td>\n<td>Select <strong>Yes<\/strong> 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 <a href=\"\/docs\/bots\/admin-console\/security-control\/security-module-overview\/#Why_Use_the_Koreai_Connector_for_Bots\">Using the Kore.ai Connector<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Add Additional Fields<\/h4>\n<ol>\n<li>Click <strong>+\u00a0Add\u00a0Additional Fields <\/strong>to open the <strong>Additional Fields<\/strong> window, and then enter one or more key\/value pairs that represent additional authorization input fields if required as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestAuthOAuthV1AddFields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9863\" src=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestAuthOAuthV1AddFields.png\" alt=\"Additional Authorization Fields\" width=\"501\" height=\"346\" \/><\/a><\/li>\n<li>Specify the following fields:<br \/>\n<strong>Field Key<\/strong> &#8211; The\u00a0name of the custom field to specify\u00a0for authorization.<strong>Field Value<\/strong> &#8211; The value of the custom field to specify for the authorization.<\/li>\n<li>Click <strong>Add<\/strong> to save the <strong>Additional Field<\/strong>.<\/li>\n<li>To add more <strong>Additional Fields<\/strong>, click <strong>Add<\/strong>\u00a0in the <strong>Additional Fields<\/strong> section.<\/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<h2><span class=\"ez-toc-section\" id=\"Authorization_Fields\"><span class=\"wysiwyg-font-size-large\">Authorization Fields<\/span><\/span><\/h2>\n<p>By default, authorization fields are configured as part of the header of the task\u00a0request message. If your task\u00a0request requires additional authorization fields or the expected authorization is not part of the header, for example, social security number or PIN,<\/p>\n<ol>\n<li>Click <strong>+ Add\u00a0Authorization Field<\/strong>\u00a0and then define the fields as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicAuthField-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9855\" src=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicAuthField-1.png\" alt=\"Authorization Fields for Basic Auth\" width=\"488\" height=\"350\" \/><\/a><\/li>\n<li>In the <strong>Field Type<\/strong> 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.<br \/>\n<strong>Header<\/strong> &#8211;\u00a0The Bot\u00a0expects the authorization fields as part of the header\u00a0of the request.<strong>Payload<\/strong> &#8211; The Bot\u00a0expects the authorization fields as part of the content of the body of the request.<strong>Query String<\/strong> &#8211;\u00a0The Bot\u00a0expects the authorization fields as a query in the body\u00a0of the request.<strong>Path Param<\/strong> &#8211; The Bot 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,\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<li>To add additional authorization fields, click <strong>Add<\/strong>\u00a0in the <strong>Authorization\u00a0Fields<\/strong> section.<\/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<h2><span class=\"ez-toc-section\" id=\"Testing\"><span class=\"wysiwyg-font-size-large\">Testing<\/span><\/span><\/h2>\n<p>After you save the authorization, you can test your authorization definition on the <strong>Authorization<\/strong> page.<\/p>\n<ol>\n<li>Click <strong>Test Authorization<\/strong> before continuing to develop the remain steps of your task.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestAuth-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9864\" src=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestAuth-1.png\" alt=\"Test Authorization\" width=\"976\" height=\"187\" \/><\/a><\/li>\n<li>When you\u00a0click <strong>Test Authorization<\/strong>, the test is executed using the authentication token URLs and the <strong>Consumer Key<\/strong> and <strong>Consumer Token<\/strong>. If the tenancy was defined, the <strong>Test Authorization<\/strong> dialog is displayed\u00a0as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYTestAuthorizationDialogoAuth.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8681 size-full\" src=\"\/wp-content\/uploads\/sites\/22\/DIYTestAuthorizationDialogoAuth.png\" alt=\"Test Authorization Dialog - oAuth\" width=\"594\" height=\"295\" \/><\/a><\/li>\n<li>Click <strong>Test<\/strong>\u00a0to begin the authorization test.\u00a0When 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. 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.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestTestFail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9858\" src=\"\/wp-content\/uploads\/sites\/22\/DIYActionTaskAPIRequestTabAuthenticationSectionBasicTestTestFail.png\" alt=\"Authentication Test Fail\" width=\"578\" height=\"409\" \/><\/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<h2><span class=\"ez-toc-section\" id=\"How_it_all_Works\"><span class=\"wysiwyg-font-size-large\">How it all Works\u00a0<\/span><\/span><\/h2>\n<ol>\n<li>The Kore.ai application obtains an unauthorized request token from the web application. The Kore.ai\u00a0application redirects the user to a login dialog at the web application.<\/li>\n<li>The user authorizes the request token, associating it with their account. The web application\u00a0redirects the user back to the Kore.ai application.<\/li>\n<li>The Kore.ai application\u00a0exchanges the request token for an access token.<\/li>\n<li>The access token allows the Kore.ai application\u00a0to access a protected resource at the provider, on behalf of the user.<\/li>\n<\/ol>\n<p>The following illustration is an example of the <strong>oAuth v1 <\/strong>authorization type fields that you must define to enable a customized authorization for your task.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYOAUTHV1-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8675 size-full\" src=\"\/wp-content\/uploads\/sites\/22\/DIYOAUTHV1-3.png\" alt=\"New Authorization Mechanism - oAuth V1\" width=\"448\" height=\"981\" \/><\/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><\/div><\/div><\/div><\/div><\/div><\/section><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\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/div><\/div><\/div><\/div><\/div><\/section>\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 authorization for the alert tasks can be set up using the OAuth v1. Setting Up OAuth is an open protocol to allow secure authorization in a simple and standard method from...","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-27042","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/27042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/comments?post=27042"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/27042\/revisions"}],"predecessor-version":[{"id":27043,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/27042\/revisions\/27043"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/media?parent=27042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/categories?post=27042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/tags?post=27042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}