{"id":13620,"date":"2023-10-10T08:11:13","date_gmt":"2023-10-10T13:11:13","guid":{"rendered":"https:\/\/docs.iotconnect.io\/partnerprogram\/?page_id=13620"},"modified":"2023-10-19T08:22:03","modified_gmt":"2023-10-19T13:22:03","slug":"ids-integration","status":"publish","type":"page","link":"https:\/\/docs.iotconnect.io\/partnerprogram\/resources\/ids-integration\/","title":{"rendered":"IDS integration"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Typically, each application layer (front-end, middle-tier and back-end) resource must be protected by implementing authentication and\/or authorization \u2013 often against the same user store. Outsourcing these fundamental security functions to a security token service prevents duplicating this functionality across all applications and endpoints.<\/p>\n<p>Restructuring the application to support a security token service leads to the following architecture and protocols:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8807\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-01.jpg\" alt=\"\" width=\"1755\" height=\"1048\" \/><\/p>\n<h3 id=\"authentication\">Authentication<\/h3>\n<p>Authentication is needed when an application needs to verify the identity of the current user. Usually, applications manage user data and makes sure that the user data is accessible to an authenticated user only. The most common examples are (classic) web applications \u2013 but native and JS-based applications also have a need for authentication.<\/p>\n<p>The most used authentication protocols are SAML2p, WS-Federation and OpenID Connect \u2013 SAML2p being the most popular and the most widely deployed.<\/p>\n<p>OpenID Connect is the newest of the three but it is getting wide popularity since it has the potential to cater modern application needs. It was built for mobile application scenarios right from the start and is designed to be API friendly.<\/p>\n<h3 id=\"how-identity-server-can-help-in-iotonnect\">How Identity Server can help in \/IOTCONNECT\u2122<\/h3>\n<p>Identity Server (IDS) is the middleware that adds the spec compliant OpenID Connect and OAuth 2.0 endpoints to an arbitrary application.<\/p>\n<p>Typically, you build (or re-use) an application that contains a login and logout page (and maybe consent &#8211; depending on your needs), and the Identity Server middleware adds the necessary protocol heads to it so the client applications can talk to it using those standard protocols.<\/p>\n<p>Below is the architecture diagram that explains how default\/external Identity provider(s) (IDP) redirects to \/IOTCONNECT\u2122 or external IDP login system using \/IOTCONNECT\u2122 Identity Server.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8808\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-02.jpg\" alt=\"\" width=\"1755\" height=\"930\" \/><\/p>\n<p>The \/IOTCONNECT\u2122 platform supports authentication with default IDP as well as external IDP. Once the company user initiates login from the \/IOTCONNECT\u2122 portal, it first redirects to the Identity server (login.iotconnect.io) and verify initial company configuration(s). Finally, the System redirects the user to the \/IOTCONNECT\u2122 default login page or external IDP login page based on company configuration.<\/p>\n<h3 id=\"user-info-stored-in-ids\">User Info Stored In IDS<\/h3>\n<p>\/IOTCONNECT\u2122 IDS stores below-mentioned user information in the data store for both default and external IDP.<\/p>\n<ul>\n<li>First Name<\/li>\n<li>Last Name<\/li>\n<li>Email Address<\/li>\n<li>Password (In case of default IDP): Hash Encrypted with bcrypt.<\/li>\n<li>Password Policy (In case of default IDP): Minimum Length (8), Max Length (50), Password must contain at least one upper case character and one special character<\/li>\n<li>Password RegEx : &#8220;^((?=.*?[#?!@$%^&#038;*-])(?=.*[A-Z])).*&#8221;<\/li>\n<\/ul>\n<h3 id=\"default-authentication-flow\">\/IOTCONNECT\u2122 &#8211; Default Authentication Flow<\/h3>\n<p>Custom authentication flow will help companies that do not have any existing user base on any third-party identity provider such as Azure AD, Auth0, Okta etc. It will allow \/IOTCONNECT\u2122 companies to store their user information in Identity server SQL database.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8809\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-03.jpg\" alt=\"\" width=\"1755\" height=\"930\" \/><\/p>\n<p>By default, the \/IOTCONNECT\u2122 platform provides custom IDP if the company has not defined any identity provider before creating the company in \/IOTCONNECT\u2122. <\/p>\n<h3 id=\"authentication-flow-with-external-idp\">\/IOTCONNECT\u2122 &#8211; Authentication Flow with external IDP<\/h3>\n<p>External authentication flow can be useful when any registered company already has an existing user base available on external IDP and want to use the \/IOTCONNECT\u2122 platform. <\/p>\n<p>Companies that seek to integrate external IDP with \/IOTCONNECT\u2122, must follow certain steps on their account and provide the required information to \/IOTCONNECT\u2122. The overall high-level process to integrate external IDP with IDS is depicted below:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8810\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-04.jpg\" alt=\"\" width=\"1754\" height=\"930\" \/><\/p>\n<h3 id=\"steps-for-external-idp-with-iotconnect\">Steps to integrate External IDP with \/IOTCONNECT\u2122<\/h3>\n<p>Let us see how a company can integrate external IDP with \/IOTCONNECT\u2122 IDS. We have taken Auth0 IDP as an example below. <\/p>\n<p>To integrate Auth0 with \/IOTCONNECT\u2122, a company needs to provide basic information from Auth0 Application to \/IOTCONNECT\u2122. The steps that the company needs to follow are as below:<\/p>\n<ul>\n<li>Create an application on your Auth0 domain<\/li>\n<li>Provide the client ID and secrets from created application<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8811\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-05.jpg\" alt=\"\" width=\"1071\" height=\"815\" \/><\/li>\n<li>Enable Auth0 API Management that has user management rights. After enabling, it will provide the API management URL to \/IOTCONNECT\u2122. For example: https:\/\/yourauth0domain.com\/api\/v2\/<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8812\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-06.jpg\" alt=\"\" width=\"903\" height=\"512\" \/><\/li>\n<li>Setup callback URL of login and logout for \/IOTCONNECT\u2122<br \/>\nAllowed callback URL : <a href=\"https:\/\/login.iotconnect.io\/signin-ascale\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/login.iotconnect.io\/signin-ascale<\/a><br \/>\nAllowed logout URL: <a href=\"https:\/\/login.iotconnect.io\/signin-ascale\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/login.iotconnect.io\/signout-callback-ascale<\/a><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8813\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-07.png\" alt=\"\" width=\"1185\" height=\"772\" \/><\/li>\n<\/ul>\n<h3 id=\"solutions-with-iotconnect-ids\">Solutions with \/IOTCONNECT\u2122 IDS<\/h3>\n<p>\/IOTCONNECT\u2122 offers two ways to support authentication for companies who want to build solutions on top of it.<br \/>\n<strong>Using \/IOTCONNECT\u2122 Authentication API management.<\/strong><br \/>\nCompanies can use \/IOTCONNECT\u2122 Consumer APIs management that a Solution developer uses typically to build their Solution on top of \/IOTCONNECT\u2122. Solutions can use Authenticate API module to authenticate their users. The solution key is mandatory to perform user authentication. The screenshot to illustrate the same is given below.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-8814\" src=\"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-content\/uploads\/2021\/04\/ids-08.png\" alt=\"\" width=\"1451\" height=\"833\" \/><\/p>\n<h3 id=\"implicit-flow\">Implicit Flow \/ Redirection Flow<\/h3>\n<p>In this flow, the user will be redirected to either \/IOTCONNECT\u2122 IDS login page or external IDP login. IDS will decide based on logged in user with company configuration. To initiate Implicit Flow solution the company needs to have the following details to start integrating on their front-end portal (UI). There are different libraries available to integrate Implicit on UI framework. Your library needs to setup the URL given below once all setup is done from \/IOTCONNECT\u2122. At Present, Solution developer can provide redirect and logout redirect URL via Email or by creating a support ticket. Alternatively, one can contact \/IOTCONNECT\u2122 support team as well.<br \/>\n<strong>Authority URL:<\/strong> <a href=\"https:\/\/login.iotconnect.io\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/login.iotconnect.io<\/a><br \/>\n<strong>ClientID:<\/strong> iotconnect<br \/>\n<strong>Redirect URL:<\/strong> <a href=\"https:\/\/yoursolutiondomain.com\/callback\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/yoursolutiondomain.com\/callback<\/a><br \/>\n<strong>Logout Redirect URL:<\/strong> <a href=\"https:\/\/yoursolutiondomain.com\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/yoursolutiondomain.com<\/a><br \/>\n<strong>Response Type:<\/strong> &#8220;id_token token&#8221;<br \/>\n<strong>Scope:<\/strong> &#8220;openid profile iotconnect.api.fullaccess&#8221;<br \/>\n<strong>acr_values:<\/strong> &#8220;solutionCode:YOUR_SOLUTION_GUID&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Typically, each application layer (front-end, middle-tier and back-end) resource must be protected by implementing authentication and\/or authorization \u2013 often against the same user store. Outsourcing these fundamental security functions to a security token service prevents duplicating this functionality across all applications and endpoints. Restructuring the application to support a security token service leads to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":13612,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-page-full-width.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"acf":[],"_links":{"self":[{"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/pages\/13620"}],"collection":[{"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/comments?post=13620"}],"version-history":[{"count":3,"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/pages\/13620\/revisions"}],"predecessor-version":[{"id":13772,"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/pages\/13620\/revisions\/13772"}],"up":[{"embeddable":true,"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/pages\/13612"}],"wp:attachment":[{"href":"https:\/\/docs.iotconnect.io\/partnerprogram\/wp-json\/wp\/v2\/media?parent=13620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}