douduan6731 2017-03-30 11:30 采纳率: 0%
浏览 35
已采纳

如何检查用户是否在2个不同的Web应用程序上进行了身份验证?

I've been looking around the Internet but I cannot find anything related to my specific case online.

Let's assume there are 2 web applications. wa1 and wa2. wa1 is written in PHP, located on domain1.com and wa2 is written in Python, located on domain2.com. There is a common database user_info which stores user information such as usernames and passwords, and another database user_logged_in which lists users and their sessions.

The user will authenticate through wa1. How can I check if the user is authenticated in wa2, if I cannot use remote MySQL to access the user_logged_in database? Is it possible to set a cookie such that the site on domain2.com can read the cookie set by domain1.com?

  • 写回答

1条回答 默认 最新

  • dongxing7318 2017-03-30 11:42
    关注

    If I got it right, I believe that you need a Single Sign On solution.

    I'd recommend that you take a look at OpenID Connect specifications.

    In this scenario you will need to add a third "app", which is going to be the responsible for issuing tokens to authenticated users (some sort of Identity Server). All the user related information will be stored and managed by this service.

    The apps themselves will rely on the Tokens in order to check if there's a valid user and they can fetch user information from the Identity Server.

    A great option for that is IdentityServer, which is open-source: https://identityserver.github.io/Documentation/

    Their documentation is very good and will give you a more in-depth explanation.

    Hope it helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥30 用arduino开发esp32控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿