最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

oauth 2.0 - How to pass Authorization header from Next.js app to backend service? - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论