又一个论坛密码问题

发布于 2024-10-10 03:22:55 字数 233 浏览 0 评论 0原文

我有一个使用 ASP.NET 会员资格提供程序 的 ASP.NET Web 应用程序。除此之外,我在子域中还有另一个论坛网站。我希望当用户在我的网站注册时,它也会自动在论坛中注册。换句话说,当用户在我的网站注册时,它也可以使用该凭据登录论坛。

因此,当用户在我的网站中注册时,我也会在 yaf_User 表中添加一条记录。但问题是虽然 yaf_User 处有一个密码字段,YAF 并没有在该字段保存密码。我不知道YAF把密码保存在哪里?

I have an asp.net web-from application which uses ASP.NET membership provider . Beside this I have yet another forum website in sub-domain. I would like when user register in my site , it automatically register in forum , too . By another word when user register in my site , it can use that credential for loging-in to forum as well .

So , when ever a user register in my site , I add a record in yaf_User table too . But the problem is although there is a password field at yaf_User , YAF Doesn't save password at that field . I don't know where does YAF saves passwords ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

为人所爱 2024-10-17 03:22:55

更好、更简单的解决方案是对 Web 应用程序和论坛使用相同的会员提供程序(我假设也使用会员提供程序)。既然您希望应用程序和论坛使用相同的用户名,为什么不使用相同的用户数据库呢?

至于密码,默认是加密的,不是明文的。检查 web.config 中提供商设置的 enablePasswordRetrieval

在两个应用程序的 web.config 中,将域属性设置为顶级域:

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880" domain="toplevel.com"  />
</authentication>

这可确保如果您登录应用程序或论坛,您也将自动登录另一个应用程序。

A better and easier solution would be to use the same membership provider for both the web application and the forum (which I assume is also using the membership provider). Since you want the same username for both the app and the forum, why not just use the same user database?

As for the password, default it is encrypted and not clear text. Check the enablePasswordRetrieval of your provider setting in web.config.

In web.config for both apps set the domain attribute to the top level domain:

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880" domain="toplevel.com"  />
</authentication>

This ensures that if you log in on either the app or the forum, you will automatically be logged in to the other as well.

哥,最终变帅啦 2024-10-17 03:22:55

YAF.NET 使用 ASP.NET 成员身份(以及角色和配置文件)作为主机。 yaf_user 表只是一个自动更新的论坛特定从属表。该表中的密码字段是旧的,可​​以忽略。 YAF 不再关心密码了。如果用户登录,论坛就会很高兴。因此,只要您的会员资格和表单身份验证票证在您的主域和 YAF 子域上都匹配,就不会有任何问题。

YAF.NET uses ASP.NET membership (as well as roles and profile) as a master. The yaf_user table is just a forum-specific slave that is updated automatically. The password field in that table is legacy and can be ignored. YAF doesn't care about passwords anymore. If the user is logged in, the forum is happy. So, as long as your membership and forms authentication ticket match up on both your main and YAF sub-domain, you shouldn't have any problems.

风情万种。 2024-10-17 03:22:55

那蓬,
我已经完成了自动登录 asp.net 会员资格
在第一个 Web 应用程序中
1.填写web.config

<machineKey validationKey="282487E295028E59B8F411ACB689CCD6F39DDD21E6055A3EE480424315994760ADF21B580D8587DB675FA02F79167413044E25309CCCDB647174D5B3D0DD9141" decryptionKey="8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099" validation="SHA1"/>
  1. 我在 [WebApplication1]/login.aspx] 定义了登录页面
    登录验证填写事件:

    FormsAuthentication.SetAuthCookie([用户名], false);
    System.Web.HttpCookie MyCookie =System.Web.Security.FormsAuthentication.GetAuthCookie(User.Identity.Name.ToString(),false);
    MyCookie.Domain = "127.0.0.1";//二级域名
    //我在发布我的网站后尝试在我的计算机上
    Response.AppendCookie(MyCookie);

在第二个 Web 应用程序中
1. 网页配置

这就是我使用 YAF 或其他网站的会员身份进行单点登录的所有解决方案。

如果解决不了这个问题,可以问我,[email protected]

Naphong,
I have done with automatic-login asp.net membership
In First Web Application
1. fill in web.config

<machineKey validationKey="282487E295028E59B8F411ACB689CCD6F39DDD21E6055A3EE480424315994760ADF21B580D8587DB675FA02F79167413044E25309CCCDB647174D5B3D0DD9141" decryptionKey="8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099" validation="SHA1"/>
  1. Login Page I have defined at [WebApplication1]/login.aspx]
    Login Authenticate fill in event :

    FormsAuthentication.SetAuthCookie([username], false);
    System.Web.HttpCookie MyCookie =System.Web.Security.FormsAuthentication.GetAuthCookie(User.Identity.Name.ToString(),false);
    MyCookie.Domain = "127.0.0.1";//the second level domain name
    //I try to my computer after publish my site
    Response.AppendCookie(MyCookie);

In Second WebApplication
1. web.config

That's all my solution with Single Sign On with Membership of YAF or other web site.

You can ask me if you can't solve this problem, [email protected]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文