{"id":94,"date":"2019-09-25T06:35:22","date_gmt":"2019-09-25T06:35:22","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/reactify\/?page_id=94"},"modified":"2019-10-15T08:58:43","modified_gmt":"2019-10-15T08:58:43","slug":"authentication","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/reactify\/authentication\/","title":{"rendered":"Authentication"},"content":{"rendered":"\n<p>Here is step by step instructions to use both type of authentication in your template.<\/p>\n\n\n\n<h4 id=\"authentication-with-firebase\">Authentication With Firebase<\/h4>\n\n\n\n<p>To add Firebase to your app, you&#8217;ll need a Firebase project, Firebase SDK and a short snippet of initialisation code that has a few details about your project.<\/p>\n\n\n\n<ol><li class=\"\">Create a Firebase project in the <a href=\"https:\/\/console.firebase.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Firebase console<\/a>, if you don&#8217;t already have one.<ol><li class=\"\">If you already have an existing Google project associated with your app, click Import Google Project. Otherwise, click Create New Project.<\/li><li class=\"\">If you already have apps in your project, click Add Another App from the project overview page.<\/li><\/ol><\/li><li class=\"\">Click Add Firebase to your web app.<\/li><li class=\"\">Copy the initialisation code snippet, we will use this code in the next step.<\/li><li class=\"\">Open the file <code>src-&gt;firebase-&gt;index.js<\/code> and search for the <code>const config<\/code> &amp; paste the code inside it:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"1024\" height=\"513\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/firebaseinit-1024x513.png\" alt=\"\" class=\"wp-image-95\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/firebaseinit-1024x513.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/firebaseinit-300x150.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/firebaseinit-768x385.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/firebaseinit.png 1090w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Firebase Initialisation <\/figcaption><\/figure><\/div>\n\n\n\n<h4 id=\"removing-firebase-authentication\">Removing Firebase Authentication<a href=\"#removing-firebase-authentication\"><\/a><\/h4>\n\n\n\n<p>If you want to remove the firebase authentication from your existing template then please follow this link <a href=\"https:\/\/docs.theironnetwork.org\/reactify\/faqsfrequently-asked-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Completely Remove Firebase From Template<\/a> and follow the steps given.<\/p>\n\n\n\n<h4 id=\"authentication-with-auth-0-js\">Authentication With Auth0-js<a href=\"#authentication-with-auth-0-js\"><\/a><\/h4>\n\n\n\n<p>Reactify comes with Auth0 authentication. You can easily authorise user in your app. Here is step by step instructions to use auth0 in your app.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"1024\" height=\"488\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/auth0-1024x488.png\" alt=\"\" class=\"wp-image-96\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/auth0-1024x488.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/auth0-300x143.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/auth0-768x366.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/auth0.png 1096w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Auth0 SignIn Preview <\/figcaption><\/figure><\/div>\n\n\n\n<h5><strong>Configure Callback URLs<\/strong><\/h5>\n\n\n\n<p>A callback URL is a URL in your application where Auth0 redirects the user after they have authenticated.<\/p>\n\n\n\n<p>You need to whitelist the callback URL for your app in the Allowed Callback URLs field in your Application Settings. If you do not set any callback URL, your users will see a mismatch error when they log in.<\/p>\n\n\n\n<p>Open <code>auth0-variables.js<\/code> to configure callback url under the <code>src-&gt;Auth<\/code> directory. You also need to update the <code>clientId<\/code> &amp; <code>domain<\/code> according to your account&#8217;s configuration.<br><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"1024\" height=\"508\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoconfig-1024x508.png\" alt=\"\" class=\"wp-image-97\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoconfig-1024x508.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoconfig-300x149.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoconfig-768x381.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoconfig.png 1094w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Auth0.js Config <\/figcaption><\/figure><\/div>\n\n\n\n<p>You also need to add callback url in auth0 application settings. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"1024\" height=\"488\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoset-1024x488.png\" alt=\"\" class=\"wp-image-98\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoset-1024x488.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoset-300x143.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoset-768x366.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/09\/authoset.png 1093w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Auth0 Application Settings<\/figcaption><\/figure><\/div>\n\n\n\n<p>To get more information about Auth0 check the official <a href=\"https:\/\/auth0.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">document<\/a>.<\/p>\n\n\n\n<h4 id=\"removing-auth0-authentication\">Removing Auth0 Authentication<a href=\"#removing-auth0-authentication\"><\/a><\/h4>\n\n\n\n<p>Open the <code>src-&gt;container-&gt;SigninFirebase.js<\/code> file and search for the code <code>session-inner-wrapper<\/code> and comment the code given below:SigninFirebase.js<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\/* &lt;FormGroup className=\"mb-15\"&gt;<br>       &lt;Button<br>              variant=\"contained\"<br>              className=\"btn-info btn-block text-white w-100\"<br>              size=\"large\"<br>              onClick={() =&gt; this.loginAuth0()}<br>         &gt;<br>         Sign In With Auth0<br>        &lt;\/Button&gt;<br>&lt;\/FormGroup&gt; *\/} <\/pre>\n\n\n\n<blockquote class=\"wp-block-quote blockquote-warning\"><p>Make sure you only commented out the <em><strong>Sign In With Auth0<\/strong><\/em> Button only not the other ones.<\/p><\/blockquote>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"94\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"94\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Here is step by step instructions to use both type of authentication in your template. Authentication With Firebase To add Firebase to your app, you&#8217;ll need a Firebase project, Firebase SDK and a short snippet of initialisation code that has a few details about your project. Create a Firebase project in the Firebase console, if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/94"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":8,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/94\/revisions"}],"predecessor-version":[{"id":684,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/94\/revisions\/684"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/media?parent=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}