Focuses on API authentication, access scopes, and permission management.
Hi,
I've been trying to authenticate a request from a POS UI extension to my Remix app.
I want to use:
const { admin } = await authenticate.public.appProxy(request);or:
const { admin } = await authenticate.admin(request);
const [sessionToken, setSessionToken] = useState<string | null | undefined>( null, ); useEffect(() => { getSessionToken().then((token) => { setSessionToken(token); }); }, [shopDomain, getSessionToken]);But I cannot find any details about authenticating the request.
shopify-app/INFO] Query does not contain a signature valueAnd if I don't use any, I get an empty error.
Solved! Go to the solution
This is an accepted solution.
Actually, here was the solution:
Use the session_token and pass it as a Bearer in the fetch request.
On remix, use:
const session = await authenticate.admin(request);
But, in case of any error, I use:
const decoded = jwt.verify(token, process.env.SHOPIFY_API_SECRET!, {
algorithms: ["HS256"],
});
This is an accepted solution.
Actually, here was the solution:
Use the session_token and pass it as a Bearer in the fetch request.
On remix, use:
const session = await authenticate.admin(request);
But, in case of any error, I use:
const decoded = jwt.verify(token, process.env.SHOPIFY_API_SECRET!, {
algorithms: ["HS256"],
});