[英]How to build Front-End apart from Back-End with security?
I have some knowledge of Vue and Experience with Django, wanted to know if there's a way to safely create an app with nuxt and django rest framework.我对 Vue 有一些了解,并且有 Django 的经验,想知道是否有一种方法可以安全地使用 nuxt 和 django rest 框架创建应用程序。
I saw that Nuxt is not a server framework and e only works for doing ssr for Vue, so i was wondering how would i do to use it with drf, i thought about using and api key but since the vue app in client-side would have to access the API directly (eg: submitting forms) would be a breach, right?我看到 Nuxt 不是服务器框架,e 只适用于为 Vue 做 ssr,所以我想知道如何将它与 drf 一起使用,我考虑过使用和 api 密钥,但由于客户端的 vue 应用程序会必须直接访问 API(例如:提交表格)会违规,对吧? like, my API cannot be open to everyone and i cannot store api credentials inside vue app.比如,我的 API 不能对所有人开放,我不能在 vue 应用程序中存储 api 凭据。
Is there a way to use Nuxt & Django Rest Framework together?有没有办法一起使用 Nuxt & Django Rest 框架?
I've already answered questions regarding if Nuxt is private and how to make secure calls , reading some of those can be a nice start.我已经回答了有关 Nuxt是否私有以及如何进行安全调用的问题,阅读其中的一些内容可能是一个不错的开始。
Overall, the practice of having such communication is totally common and can be achieved with a JWT. The main points are:总的来说,进行这种通信的做法是完全常见的,可以通过 JWT 实现。要点是:
There are plenty of tutorials on the Web on how to achieve a working JWT flow. Web 上有很多关于如何实现工作 JWT 流程的教程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.