{"id":18065,"date":"2018-11-23T17:22:41","date_gmt":"2018-11-23T17:22:41","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=15457"},"modified":"2022-09-19T08:21:50","modified_gmt":"2022-09-19T07:21:50","slug":"implementing-custom-authentication","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/implementing-custom-authentication\/","title":{"rendered":"Implementing Custom Authentication"},"content":{"rendered":"<p><span style=\"font-weight: 400\">You can implement custom authentication for your VA by providing a URL from the service node to an external application that manages the authentication. The platform provides the necessary functionality to handle successful and failed authentication scenarios and manage the corresponding task flows.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Implementing custom authentication involves the following steps:<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Generate_the_Custom_Authentication_URL_from_the_Service_Node\"><span style=\"font-weight: 400\">Generate the Custom Authentication URL from the Service Node<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">To implement custom authentication, you first need to configure a dialog tasks&rsquo; service node with the URL of the authenticating service. When you do so, the platform internally appends the authentication URL you entered with the VA&rsquo;s webhook and creates a custom authentication URL. It performs to facilitate the authentication service to send back the necessary details to the Platform after completing the authentication process.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Populate_the_Context_and_Present_the_Custom_URL_to_the_User\"><span style=\"font-weight: 400\">Populate the Context and Present the Custom URL to the User<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">During task execution, when a dialog reaches the service node, the platform populates the customer authentication URL in the context and presents a message to the end-user requesting authentication credentials. Then, the platform waits for the external authentication service to send a response on the webhook.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Receive_Callback_after_Authentication\"><span style=\"font-weight: 400\">Receive Callback after Authentication<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">The external system, on its part, performs a callback to the platform using the webhook URL, which is populated in the Context Object. Once all this is complete, the dialog task progresses based on the transitions defined for the node.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Configure_the_Custom_Authentication_Service\"><span style=\"font-weight: 400\">Configure the Custom Authentication Service<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">To configure the custom authentication service, please follow the steps below:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><strong>Open the dialog task <\/strong><span style=\"font-weight: 400\">in which you want to implement the custom authentication.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Add a Service node<\/strong><span style=\"font-weight: 400\"> after the appropriate node in the task flow.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the <\/span><strong>Component Properties<\/strong><span style=\"font-weight: 400\"> tab of the node, enter a <\/span><strong>Name<\/strong><span style=\"font-weight: 400\"> for the node.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the<\/span><strong> Service Type <\/strong><span style=\"font-weight: 400\">drop-down list, select <\/span><strong>Custom Authentication Service<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the <\/span><strong>Auth URL <\/strong><span style=\"font-weight: 400\">field, enter the URL of the external authentication service.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under the <\/span><strong>Response<\/strong><span style=\"font-weight: 400\"> section, it shows the default authentication requisition message that the VA presents to the user. You can edit the message or click <\/span><strong>Manage <\/strong><span style=\"font-weight: 400\">to define advanced or channel-specific messages. Learn about <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/message-templates\/\"><span style=\"font-weight: 400\">message formatting and templates.<\/span><span style=\"font-weight: 400\"><br \/><\/span><\/a><strong>Note: <\/strong><span style=\"font-weight: 400\">The default message here is based on the default name of the service node and is as follows: <\/span><strong><em>Please use the following URL to proceed with the authentication {{context.&lt;&lt;Service Node Name&gt;&gt;.customAuthenticationURL}}. <\/em><\/strong><span style=\"font-weight: 400\">If you change the node name later, ensure that you also update the message to reflect the revised name.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Define the transitions for the node.<\/span><\/li>\n<\/ol>\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","protected":false},"excerpt":{"rendered":"<p>You can implement custom authentication for your VA by providing a URL from the service node to an external application that manages the authentication. The platform provides the necessary functionality to handle successful and failed authentication scenarios and manage the corresponding task flows. Implementing custom authentication involves the following steps: Generate the Custom Authentication URL&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-18065","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18065","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=18065"}],"version-history":[{"count":9,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18065\/revisions"}],"predecessor-version":[{"id":44918,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18065\/revisions\/44918"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=18065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=18065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=18065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}