ASP.NET和Word preSS之间共享认证 [英] Sharing authentication between ASP.NET and WordPress

查看:223
本文介绍了ASP.NET和Word preSS之间共享认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个情况下,我需要一个ASP.NET网站和Word preSS之间自动auth用户。我们的想法是,一​​旦你登录到ASP.NET网站,如果你浏览记录在WP页面自动的,反之亦然。

在ASP.NET我可以auth用户对WP数据库中,但是这是所有我能想到的,因此问题。

- 如何启用这个由向认证方案?

-Zubair <​​/ P>

解决方案

我也有类似的问题,在这里我有一个ASP.net应用程序(第三方)和PHP应用程序(内置在内部)。我已经修改与code的短短几行的ASP.net应用程序,因此它的工作是这样的:


  1. 用户登录到ASP.net应用程序

  2. 的ASP.net应用程序设置会话cookie(这是自动的)

  3. 变形例:在ASP.net添加一行与会话ID(它是在cookie)数据库和用户名

  4. 的PHP应用程序读取ASP.net会话cookie并获取会话ID

  5. PHP应用程序搜索DB的会话ID,如果被发现,它会自动会话与找到的用户名关联

我还添加了到期时间为会议,以尽量减少假冒possibilies ...

I'm in a situation where I need to auto-auth users between an ASP.NET website and WordPress. The idea is once you're logged into the ASP.NET website and if you browse the WP pages your logged in automagically and vice versa.

In ASP.NET I can auth users against WP database but that's all I can think of, so the question is.

-How to enable this by-directional authentication scheme?

-Zubair

解决方案

I had a similar problem, where I had an ASP.net application (third party) and a PHP application (built in-house). I have modified the ASP.net application with just a few lines of code, so that it worked like this:

  1. User logs to the ASP.net application
  2. The ASP.net application sets a session cookie (this is automatic)
  3. Modification: the ASP.net adds a row to the database with the session ID (which is in the cookie) and the username
  4. The PHP application reads the ASP.net session cookie and gets the session ID
  5. The PHP application searches the DB for the session ID and if it is found, it automatically associates the session with the username found

I also added an expiry time for the sessions, to minimize impersonation possibilies...

这篇关于ASP.NET和Word preSS之间共享认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆