title: Missing access token for authorization on Ebay Browse API
body: <p>I try to search items from eBay API. Within the <em>server.js</em> file at my <a href="https://www.apollographql.com/docs/apollo-server/" rel="nofollow noreferrer">Apollo Server 2</a>, I pass the token string by context property while instantiation (s. Doku: <a href="https://www.apollographql.com/docs/apollo-server/v2/essentials/data.html#context" rel="nofollow noreferrer">Apollo context argument</a>). So every request contains the authentication HTTP header property. As a tryout, for now, I just use the fixed token string. This will be changed later if I work for the client.</p>
  
  <p><em>server.js</em></p>
  
  <pre><code>import { ApolloServer } from 'apollo-server'
  import schema from './schema'
  
  const server = new ApolloServer({
     schema,
     context: ({ req }) =&gt; {
          const token = 'Bearer v^1.1#i^1#I^3#f^0#p^1#r^0#t^H4sIAAA...' // my token
  
          return {
               ...req,
               headers: {        
                   ...req.headers,
                   // enrich the header with oauth token
                   authorization: token,
               },
          }
      },
  })
  
  server.listen().then(({ url }) =&gt; console.log(` Server ready at ${url}`))
  </code></pre>
  
  <p><em>resolver method</em></p>
  
  <pre><code>// A map of functions which return data for the schema.
  const resolvers = {
      Query: {
         books(root, { keyword = '' }, context) {
            console.log(context.headers)
             fetch(`https://api.ebay.com/buy/browse/v1/item_summary/?q=${keyword}`)
               .then(response =&gt; response.json())
               .then(json =&gt; console.log(json))
  
             return []
       }
     }
  }
  </code></pre>
  
  <p>The context.header contains the authorization property:</p>
  
  <pre><code>{ host: 'localhost:4000',
    connection: 'keep-alive',
    'content-length': '108',
    accept: '*/*',
    origin: 'http://localhost:4000',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
    dnt: '1',
    'content-type': 'application/json',
    referer: 'http://localhost:4000/',
    'accept-encoding': 'gzip, deflate, br',
    'accept-language': 'de,en;q=0.9',
    authorization: 'Bearer v^1.1#i^1#f^0#p^1#r^0#I^3#t^H4sIAAAAAAAAAOV...' 
   }
  </code></pre>
  
  <p>The JSON response contains the error with <a href="https://developer.ebay.com/api-docs/static/handling-error-messages.html#Common" rel="nofollow noreferrer">errorId 1002</a>. It says <em>Access token is missing in the Authorization HTTP request header.</em>:</p>
  
  <pre><code>{ errors:
     [ { errorId: 1002,
        domain: 'OAuth',
        category: 'REQUEST',
        message: 'Missing access token',
        longMessage: 'Access token is missing in the Authorization HTTP request header.' } ] }
  </code></pre>
  
  <p>Additionally, I use a new browser tab, enter the URL <em><a href="https://api.ebay.com/buy/browse/v1/item_summary/search?q=test" rel="nofollow noreferrer">https://api.ebay.com/buy/browse/v1/item_summary/search?q=test</a></em> and add the same authorization header property (I use the <a href="https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=de&amp;utm_source=chrome-ntp-launcher" rel="nofollow noreferrer">ModHeader chrome extension</a>). I hit enter, the request works and I get the expected JSON.</p>
  
  <p>It is confusing and I don't know what I'm doing wrong while passing the token. Does somebody have an idea?</p>