title: Getting Invalid signature on incoming request with botBuilder adapter for Facebook
body: <p>I have successfully deployed this example <a href="https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/03.welcome-users" rel="nofollow noreferrer">repo</a> to azure and it is now working in the web chat and on slack. </p>
  
  <p>Now I'm trying to use the facebook adapter in my bot. I have followed the <a href="https://www.npmjs.com/package/botbuilder-adapter-facebook" rel="nofollow noreferrer">instructions</a> to use FacebookAdapter with BotBuilder and added the following code into <code>index.js</code></p>
  
  <pre><code>const { FacebookAdapter } = require('botbuilder-adapter-facebook');
  const restify = require('restify');
  
  const adapter = new FacebookAdapter({
       verify_token: process.env.FACEBOOK_VERIFY_TOKEN,
       app_secret: process.env.FACEBOOK_APP_SECRET,
       access_token: process.env.FACEBOOK_ACCESS_TOKEN
  });
  const server = restify.createServer();
  server.use(restify.plugins.bodyParser());
  server.use(restify.plugins.queryParser());
  
  server.get('/api/messages', (req, res) =&gt; {
       if (req.query['hub.mode'] === 'subscribe') {
            if (req.query['hub.verify_token'] === process.env.FACEBOOK_VERIFY_TOKEN) {
                 const val = req.query['hub.challenge'];
                 res.sendRaw(200, val);
            } else {
                 console.log('failed to verify endpoint');
                 res.send('OK');
            }
       }
  });
  
  server.post('/api/messages', (req, res) =&gt; {
       adapter.processActivity(req, res, async(context) =&gt; {
           await context.sendActivity('I heard a message!');
       });
  });
  
  server.listen(process.env.port || process.env.PORT || 3000, () =&gt; {
       console.log(`\n${ server.name } listening to ${ server.url }`);
   });
  </code></pre>
  
  <p>also in my .env file I have added the various tokens and secrets required.</p>
  
  <p>When I try testing the app locally with bot framework emulator I get the error</p>
  
  <pre><code>(node:11588) UnhandledPromiseRejectionWarning: Error: Invalid signature on incoming request
      at FacebookAdapter.&lt;anonymous&gt; (/home/ronald/Desktop/03.welcome-users/node_modules/botbuilder-adapter-facebook/lib/facebook_adapter.js:421:23)
      at Generator.next (&lt;anonymous&gt;)
      at /home/ronald/Desktop/03.welcome-users/node_modules/botbuilder-adapter-facebook/lib/facebook_adapter.js:15:71
  </code></pre>
  
  <p>I'm not sure what I'm doing wrong</p>