admin管理员组

文章数量:1336289

I am creating a Next.js web app that connects to an existing backend service to retrieve data. The backend service contains endpoints that require authentication (OAuth2 / Authorization header). There is a flow in which I could do this using the Next.js backend as a proxy (browser -> Next.js backend -> existing backend service). In this scenario, the backend has the user's auth token and adds it to the request to the backend service.

But this seems redundant. I want to call my backend service directly from the frontend using something like Axios in the frontend. Is this possible? How would I get the user's auth token in order to make this call to my backend service?

本文标签: oauth 20How to pass Authorization header from Nextjs app to backend serviceStack Overflow