title: Origin should match a registered origin URL. Origin URLs can be registered on the Account Kit developer page
body: <p>I want to integrate facebook AccounKit in my website. I refer <a href="https://github.com/auth0-blog/blog-passwordless-authentication.git" rel="nofollow noreferrer">this</a>.
  I am getting "<strong>Origin should match a registered origin URL. Origin URLs can be registered on the Account Kit developer page.</strong>" error in debug mode. What is the solution for this? I have added domain URLs in Account setting page as well as AccountKit Setting also. </p>
  
  <p>Attached Images for reference.</p>
  
  <p>1.<a href="https://i.stack.imgur.com/sfYQG.png" rel="nofollow noreferrer">Error Image</a>  2. <a href="https://i.stack.imgur.com/S7sf8.png" rel="nofollow noreferrer">App Settings</a>
   3. <a href="https://i.stack.imgur.com/GA7xt.png" rel="nofollow noreferrer">AccountKit Setting</a></p>
  
  <p>1) <strong>Server.js</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const fs = require('fs');
  const Guid = require('guid');
  const express = require('express');
  const bodyParser = require("body-parser");
  const Mustache  = require('mustache');
  const Request  = require('request');
  const Querystring  = require('querystring');
  const app = express();
  
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
    
  var csrf_guid = Guid.raw();
  const api_version = "v1.0";
  const app_id = "**************";
  const app_secret = '*************************';
  const me_endpoint_base_url = 'https://graph.accountkit.com/v1.0/me';
  const token_exchange_base_url = 'https://graph.accountkit.com/v1.0/access_token'; 
  
  function loadLogin() {
    return fs.readFileSync('dist/login.html').toString();
  }
  
  app.get('/', function(request, response){
    var view = {
      appId: app_id,
      csrf: csrf_guid,
      version: api_version,
    };
  
    var html = Mustache.to_html(loadLogin(), view);
    response.send(html);
  });
  
  function loadLoginSuccess() {
    return fs.readFileSync('dist/login_success.html').toString();
  }
  
  app.post('/sendcode', function(request, response){
    // CSRF check
    if (request.body.csrf_nonce === csrf_guid) {
      var app_access_token = ['AA', app_id, app_secret].join('|');
      var params = {
        grant_type: 'authorization_code',
        code: request.body.code,
        access_token: app_access_token
        appsecret_proof: app_secret
      };
    
      // exchange tokens
      var token_exchange_url = token_exchange_base_url + '?' + Querystring.stringify(params);
      Request.get({url: token_exchange_url, json: true}, function(err, resp, respBody) {
        console.log(respBody);
        var view = {
          user_access_token: respBody.access_token,
          expires_at: respBody.expires_at,
          user_id: respBody.id, 
        };
        // get account details at /me endpoint
        var me_endpoint_url = me_endpoint_base_url + '?access_token=' + respBody.access_token;
        Request.get({url: me_endpoint_url, json:true }, function(err, resp, respBody) {
          // send login_success.html
          console.log(respBody);
          if (respBody.phone) {
            view.method = "SMS"
            view.identity = respBody.phone.number;
          } else if (respBody.email) {
            view.method = "Email"
            view.identity = respBody.email.address;
          }
          var html = Mustache.to_html(loadLoginSuccess(), view);
          response.send(html);
        });
      });
    } 
    else {
      // login failed
      response.writeHead(200, {'Content-Type': 'text/html'});
      response.end("Something went wrong. :( ");
    }
  });
  
  app.listen(process.env.PORT);</code></pre>
  </div>
  </div>
  
  2) <strong>Login.html</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;Password Free: Facebook Account Kit&lt;/title&gt;
    &lt;link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"&gt;
    &lt;link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css"&gt;
    &lt;style&gt;
     body {
      text-align: center;
      background: #EEE;
     }
     .mdl-button {
      width: 100%;
     }
    &lt;/style&gt;
    &lt;script defer src="https://code.getmdl.io/1.1.3/material.min.js"&gt;&lt;/script&gt;
    
    &lt;script src="https://sdk.accountkit.com/en_US/sdk.js"&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
  
    &lt;div class="mdl-grid"&gt;
      &lt;div class="mdl-cell mdl-cell--4-col mdl-cell--4-offset"&gt;
       &lt;div class="mdl-card mdl-shadow--2dp"&gt;
       &lt;div class="mdl-card__supporting-text"&gt;
       &lt;h1 class="mdl-typography--title"&gt;Passwordless Authentication&lt;/h1&gt;
       &lt;h2 class="mdl-typography--subhead"&gt;Facebook Account Kit&lt;/h2&gt;
       &lt;p&gt;&lt;strong&gt;Login via:&lt;/strong&gt;&lt;/p&gt;
       &lt;ul class="demo-list-icon mdl-list"&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;span class="mdl-list__item-primary-content"&gt;
           &lt;button onclick="loginWithSMS();" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-typography--text-center"&gt;SMS&lt;/button&gt;
         &lt;/span&gt;
       &lt;/li&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;button onclick="loginWithEmail();" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent mdl-typography--text-center"&gt; Email&lt;/button&gt;
       &lt;/li&gt;
     &lt;/ul&gt;
       &lt;/div&gt;
       &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;form id="my_form" name="my_form" action="/sendcode" method="POST" style="display: none;"&gt;
     &lt;input type="text" id="code" name="code"&gt;
     &lt;input type="text" id="csrf_nonce" name="csrf_nonce"&gt;
     &lt;input type="submit" value="Submit"&gt;
    &lt;/form&gt;
  
    &lt;script&gt;
      // initialize Account Kit with CSRF protection
      AccountKit_OnInteractive = function(){
       console.log("{{abcd}}")
        AccountKit.init(
          {
            appId:*****************, 
            state:"{{abcd}}", 
            version:"v1.0",
      debug:true
          }
        );
      };
  
      // login callback
      function loginCallback(response) {
        console.log(response);
        if (response.status === "PARTIALLY_AUTHENTICATED") {
          document.getElementById("code").value = response.code;
          document.getElementById("csrf_nonce").value = response.state;
          document.getElementById("my_form").submit();
        }
        else if (response.status === "NOT_AUTHENTICATED") {
          // handle authentication failure
        }
        else if (response.status === "BAD_PARAMS") {
          // handle bad parameters
        }
      }
  
      function loginWithSMS(){
       AccountKit.login("PHONE",{}, loginCallback);
      }
  
      function loginWithEmail(){
       AccountKit.login("EMAIL", {}, loginCallback);
      }
    &lt;/script&gt;
   &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>3)Login-Success.html</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;AccountKitJS App&lt;/title&gt;
    &lt;link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"&gt;
    &lt;link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css"&gt;
    &lt;style&gt;
     body {
      text-align: center;
      background: #EEE;
     }
     .mdl-button {
      width: 100%;
     }
    &lt;/style&gt;
    &lt;script defer src="https://code.getmdl.io/1.1.3/material.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="mdl-grid"&gt;
     &lt;div class="mdl-cell mdl-cell--4-col mdl-cell--4-offset"&gt;
      &lt;div class="mdl-card mdl-shadow--2dp"&gt;
      &lt;div class="mdl-card__supporting-text"&gt;
      &lt;h1 class="mdl-typography--title"&gt;Passwordless Authentication&lt;/h1&gt;
      &lt;h2 class="mdl-typography--subhead"&gt;You're In!&lt;/h2&gt;
      &lt;p&gt;&lt;strong&gt;Details:&lt;/strong&gt;&lt;/p&gt;
       &lt;ul class="demo-list-icon mdl-list"&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;span class="mdl-list__item-primary-content"&gt;
           &lt;i class="material-icons mdl-list__item-icon"&gt;fingerprint&lt;/i&gt;
           &lt;span id="token"&gt;{{method}}&lt;/span&gt;
         &lt;/span&gt;
       &lt;/li&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;span class="mdl-list__item-primary-content"&gt;
           &lt;i class="material-icons mdl-list__item-icon"&gt;face&lt;/i&gt;
           &lt;span id="nickname"&gt;{{identity}}&lt;/span&gt;
         &lt;/span&gt;
       &lt;/li&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;span class="mdl-list__item-primary-content"&gt;
           &lt;i class="material-icons mdl-list__item-icon"&gt;person&lt;/i&gt;
           &lt;span id="user_id"&gt;{{user_id}}&lt;/span&gt;
         &lt;/span&gt;
       &lt;/li&gt;
       &lt;li class="mdl-list__item"&gt;
         &lt;span class="mdl-list__item-primary-content"&gt;
           &lt;button onclick="goToLogin()" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-typography--text-center"&gt;Try Another&lt;/button&gt;
         &lt;/span&gt;
       &lt;/li&gt;
     &lt;/ul&gt;
      &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
  
   &lt;script&gt;
        function goToLogin(){
       window.location.href = "/";
     }
   &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>