Sales Channel Setup: Trouble with Getting Offline Token Value In Last Stage of Store Install Process

UmmmSoftware
New Member
1 0 0

TL;DR

When testing a Sales Channel install on one of my test stores, things seem to be working appropriately. In the final stage of the process I'm getting a 200 response, but I can't figure out if the token value is included, and if so how to view it. 

Request setup in my express app:

const token = await fetch(`https://${shop}/admin/oath/access_token`, {method: 'POST', body: JSON.stringify({
       client_id: APP_API_KEY,
       client_secret: APP_API_SECRET_KEY,
       code: {nonce created in previous auth step}
})});
 
Response:
 
 Response {

  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: Gunzip {
      _writeState: [Uint32Array],
      _readableState: [ReadableState],
      readable: true,
      _events: [Object: null prototype],
      _eventsCount: 6,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: true,
      allowHalfOpen: true,
      _transformState: [Object],
      _hadError: false,
      bytesWritten: 0,
      _handle: [Zlib],
      _outBuffer: <Buffer 3c 68 74 6d 6c 3e 0a 20 20 3c 62 6f 64 79 3e 0a 20 20 20 20 3c 6e 6f 73 63 72 69 70 74 3e 0a 20 20 20 20 20 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 ... 16334 more bytes>,
      _outOffset: 0,
      _chunkSize: 16384,
      _defaultFlushFlag: 2,
      _finishFlushFlag: 2,
      _defaultFullFlushFlag: 3,
      _info: undefined,
      _level: -1,
      _strategy: 0,
      [Symbol(kCapture)]: false
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    status: 200,
     statusText: 'OK',
     headers: Headers { [Symbol(map)]: [Object: null prototype] },
     counter: 1
   }
}
 
My assumption is that the response should include the offline token in some way which I then need to store in my app and use with any future requests to get store listings? Is this assumption correct?

 

0 Likes