Hello,
I built a shopify app using the Remix template. i made a custom loader in app._index.tsx and used console.log to get the access token from the session object:
export const loader = async ({ request }: LoaderFunctionArgs) => {
const { admin, session, } = await authenticate.admin(request);
console.log(session);
return null;
}
But when i call the admin API through Postman or other ways (for the same eshop), i get the error “Invalid API key or access token (unrecognized login or wrong password)”. I haven’t reinstalled the app so the access token remains the same, right? (it seems to be an offline access token). here is the output from the consoloe.log above:
Hey, were you able to find a solution for this? I am using the offline access token for the store for the X-Shopify-Access-Token header and I’m facing the same issue. Please let me know
You’re attempting to use a session token for authenticating against the Admin API.
A session token is not the same as an offline token.
A session token is a JWT that represents a specific short lived session between the merchant and your app.
A session token can be exchanged for an offline token which is long lived and intended to be stored securely in your app’s database and can be used to make Admin API requests.