{"id":18065,"date":"2018-11-23T17:22:41","date_gmt":"2018-11-23T17:22:41","guid":{"rendered":"https:\/\/developer.kore.ai\/developer-2\/?post_type=docs&#038;p=15457"},"modified":"2021-03-25T06:51:35","modified_gmt":"2021-03-25T06:51:35","slug":"implementing-custom-authentication","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-0\/docs\/bots\/bot-builder-tool\/dialog-task\/implementing-custom-authentication\/","title":{"rendered":"Implementing Custom Authentication"},"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>You can implement custom authentication for your bot by providing 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.<\/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<p>Bot Builder mechanism to implement custom authentication involves the following steps:<\/p>\n<h4>Step 1: Generating the Custom Authentication URL from the Service Node<\/h4>\n<p>To implement custom authentication, you first need to configure a Dialog tasks&#8217; Service node with the URL of the authenticating service. When you do so, the platform internally appends the authentication URL you entered with the bot\u2019s webhook and creates a Custom authentication URL. It does so to facilitate the authentication service to send back the necessary details to the platform after completing the authentication process.<\/p>\n<h4>Step 2: Populating the Context and Presenting the Custom URL to the User<\/h4>\n<p>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 asking for authentication credentials. Then, the platform waits for the external authentication service to send a response on the webhook.<\/p>\n<h4>Step 3: Receiving Callback after Completion of Authentication<\/h4>\n<p>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.<\/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=\"Configuring_the_Custom_Authentication_Service\">Configuring the Custom Authentication Service<\/span><\/h3>\n<ol>\n<li>Open the Dialog task in which you want to implement the custom authentication.<\/li>\n<li>Add a Service node after the appropriate node in the task flow.<\/li>\n<li>In the Component Properties panel of the node, enter a name for the node.<\/li>\n<li>In the<b> Service Type <\/b>drop-down list, select Custom Authentication Service.<\/li>\n<li>In the <b>Auth URL <\/b>field, enter the URL of the external authentication service.<\/li>\n<li>The Response section shows the default authentication requisition message that the bot presents to the user. You can edit the message directly or click <b>Manage <\/b>to define advanced or channel-specific messages. Learn about message formatting and templates.<br \/>\n<b>Note: <\/b>The default message here is based on the default name of the service node and is as follows: <b><i>Please use the following URL to proceed with the authentication {{context.&lt;&lt;Service Node Name&gt;&gt;.customAuthenticationURL}}. <\/i><\/b>If you change the node name later, ensure that you also update the message to reflect the revised name.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/11\/configuration.png\" rel=\"attachment wp-att-15458\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15458\" src=\"\/wp-content\/uploads\/sites\/11\/configuration.png\" alt=\"\" width=\"305\" height=\"305\" \/><\/a><\/li>\n<li>Finally, define the transitions for the node.<\/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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"You can implement custom authentication for your bot by providing 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. Bot Builder mechanism to implement custom authentication involves the following steps: Step 1:...","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\/v7-0\/wp-json\/wp\/v2\/posts\/18065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/comments?post=18065"}],"version-history":[{"count":4,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/18065\/revisions"}],"predecessor-version":[{"id":21631,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/posts\/18065\/revisions\/21631"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/media?parent=18065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/categories?post=18065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-0\/wp-json\/wp\/v2\/tags?post=18065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}