使用Laravel + ReactJS在SPA中实现CAS身份验证

我参与了一个使用 Laravel 5.5 用于后端, React 用于前端,即SPA( 单页应用程序)。 到目前为止一切顺利,但所有用户都必须通过中央身份验证服务进行身份验证,即 CAS协议。</ p>

我找到了一个能够很好地为Laravel实现 CAS Auth Workflow </ strong>的软件包, Subfission / Cas ,但该工作流程尊重传统的Web请求架构</ strong>(Laravel渲染服务器端) 根据需要向客户提供内容,在每次请求后下载呈现的html。</ p>

在这种情况下,我需要遵循SPA范例(Laravel + React),该范例首先请求 HTML </ em>和 app.js </ em>代码,后续互动只是无状态API调用</ strong>(当然是与Laravel一起提供)...... </ p >

从架构的角度来看,如何做到这一点以及最好的方法是什么? </ p>
</ div>

展开原文

原文

I am involved in a project that uses Laravel 5.5 for the backend and React for the frontend, aka SPA (Single Page Application). So far so good, but all of the users have to authenticate through a Central Authentication Service, aka CAS protocol.

I have found a package that implements CAS Auth Workflow quite well for Laravel, Subfission/Cas, but that workflow respects the traditional web requests architecture (Laravel rendering server-side contents on demand to clients, which download rendered html after every request).

In this case, I need to follow the SPA paradigm (Laravel + React), which makes an initial request for the HTML and app.js code, and subsequent interactions are just stateless API calls (served with Laravel, of course)...

From the architectural point of view, how could this be made and what would be the best approach to follow?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐