简体   繁体   English

对不同子域下的不同应用程序进行集中身份验证。

[英]Centralized authentication to different application under different subdomains.

I have two applications running under the same base domain. 我有两个在同一基本域下运行的应用程序。

docs.application.com goes to the documentation and it's written with PHP (Grav CMS). docs.application.com转到文档,并且使用PHP(Grav CMS)编写。

www.appliation.com goes to my application which is written with Node and React. www.appliation.com转到我的用Node和React编写的应用程序。

Grav CMS has a Google oauth plugin that I am using and my application also uses Google oauth to login. Grav CMS有一个我正在使用的Google oauth插件,我的应用程序也使用Google oauth登录。

I would like to centralize the login on a way that I could login to any of the applications and be automatically logged in to the other one. 我想以一种可以集中登录任何应用程序并自动登录到另一个应用程序的方式来集中登录。

I've been reading about Central Authentication Service and Cross Domain Login but so far I wasn't able to manage a solution. 我一直在阅读有关中央身份验证服务和跨域登录的信息,但到目前为止,我还无法管理解决方案。

Any thoughts? 有什么想法吗?

You have tagged this question with OAuth2 so I am telling about that. 您已经用OAuth2标记了这个问题,所以我在说。

Technically speaking OAuth2 is not Authentication tool but Authorization tool. 从技术上讲,OAuth2不是身份验证工具,而是授权工具。 However you can tweak it in such a way that you can use it for authentication. 但是,您可以对其进行调整,以便可以将其用于身份验证。

Ideally you should create another application only for Authentication, say sso.example.com. 理想情况下,您应该只为身份验证创建另一个应用程序,例如sso.example.com。 All two application will go to that for Authentication. 所有这两个应用程序将转到“身份验证”。 在此处输入图片说明

In any SSO tool you use, your both application will become you 'service provider' and the sso application will become your 'identity provider'. 在您使用的任何SSO工具中,您的两个应用程序都将成为您的“服务提供商”,而sso应用程序将成为您的“身份提供商”。 You can use Shibboleth too for that matter. 您也可以使用Shibboleth

If you use OAuth2 than only thing you will have to manage on client side is the token. 如果您使用的是OAuth2,那么您只需在客户端进行管理的就是令牌。 While shibboleth does that for you. 尽管shibboleth会为您做到这一点。 Shibboleth act as authorization server too. Shibboleth也充当授权服务器。 You can configure it in such a way that, all two application will be not accessible unless user has active session in the SSO application. 您可以通过以下方式进行配置:除非用户在SSO应用程序中具有活动会话,否则将无法访问所有两个应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM