title: Flask REST client application returns Invalid Credential after successful authentication
body: <p>I have a Flask application that authenticates with an endpoint successfully, and receives a valid token in a login() function/route.  If I call another function from login() to return some other data using this valid token, I get a 401 error  invalid credential. If I paste the same code below in my login function, the code runs just fine.</p>
  
  <p>I have verified that my header is exactly the same in both functions.
  I am using requests module to call the endpoints.  I have a feeling this is related to how Flask dispatches requests and manages session or contexts, but I can't figure out why!</p>
  
  <p>Any hints/tips?
  Thank you!</p>