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

I am creating a Next.js web app that connects to an existing backend service to retrieve data.The bac

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742406513a4437958.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信