title: Salesforce cometD: 401::Request requires authentication
body: <p>I have to subscribe to cometD Salesforce channel and hence building cometD client in python. I am using the below python library.</p>
  
  <p><a href="https://github.com/dkmadigan/python-bayeux-client" rel="nofollow noreferrer">https://github.com/dkmadigan/python-bayeux-client</a></p>
  
  <p>And below is the handshake response I am getting</p>
  
  <pre><code>{'Host': ['xxxxx.my.salesforce.com/cometd/42.0/'], 'Content-Type': ['application/x-www-form-urlencoded'], 'Authorization': ['admin@123Pi6s9Y2QVergfergregpqqY']} message={"channel":"/meta/handshake","id":"1",
              "supportedConnectionTypes":["callback-polling", "long-polling"],
              "version":"1.0","minimumVersion":"1.0"} Headers({'host': ['xxxxx.my.salesforce.com/cometd/42.0/'], 'content-type': ['application/x-www-form-urlencoded'], 'authorization': ['admin@123Pi6s9Y2QVergfergregpqqY']}) {u'successful': False, u'advice': {u'reconnect': u'none'}, u'ext': {u'replay': True, u'sfdc': {u'failureReason': u'401::Request requires authentication'}, u'payload.format': True}, u'error': u'403::Handshake denied', u'id': u'1', u'channel': u'/meta/handshake'}
  </code></pre>
  
  <p>And I am getting 401::Request requires authentication.</p>
  
  <p>In the Authorization key, I have concatenated password and Access token i.e. admin@123Pi6s9Y2QVergfergregpqqY where admin@123 is the password I use to login to Salesforce.</p>
  
  <p>I have been banging my head since 2 days but not able to figure out why handshake is failing. Any suggestions? </p>