升级到 VS 2010 / .NET 4.0 后,Membership.ValidateUser 始终返回 false

发布于 2024-08-30 13:55:26 字数 241 浏览 2 评论 0原文

不确定这是否与 VS 2010 或升级后的框架有关,但是...我们正在使用 Oracle 成员资格提供程序来对用户进行身份验证。升级之前,一切正常,但现在,尽管凭据有效,Membership.ValidateUser(user, password) 返回 false。没有抛出异常,因此很难确定问题所在。 VS 2010 中的网站管理工具仍然能够(或多或少)管理用户和角色,因此我没有理由质疑连接性。可能是什么问题?

Not sure whether this pertains to VS 2010 or to the upgraded framework, but... we are using the Oracle membership provider to authenticate users. Prior to the upgrade everything worked fine, but now Membership.ValidateUser(user, password) returns false despite valid credentials. There is no exception thrown, so it's hard to determine what the problem might be. The website administration tool in VS 2010 is still able to manage users and roles (more or less), so I have no reason to question connectivity. What might the problem be?

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

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

发布评论

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

评论(3

兰花执着 2024-09-06 13:55:26

答案(根据这篇文章)是指定hashAlgorithmType Web.config 中的“SHA1”

<membership defaultProvider="OracleMembershipProvider" hashAlgorithmType="SHA1"/>

这并没有解决现有用户的问题,但新创建的用户现在可以登录。

The answer (according to this post) is to specify hashAlgorithmType="SHA1" in the Web.config:

<membership defaultProvider="OracleMembershipProvider" hashAlgorithmType="SHA1"/>

This did not solve the problem for existing users, but newly created users can log in now.

青柠芒果 2024-09-06 13:55:26

听起来有点像我遇到的问题..

在 web.config 中添加 machineKey 元素而不是 hashAlgorithmType="SHA1" 解决了问题.. 但我仍然不明白为什么我需要把它放在那里...避风港也找不到任何文档..

您可以在这里查看我的问题..
提供的用户名或密码是不正确的。在MVC 3互联网应用中

Sounds a little bit like the problem I am having..

Adding a machineKey element to web.config instead of hashAlgorithmType="SHA1" fixed the problem.. but I still don't understand why I need to put that there... haven't been able to find any documentation either..

You can check out my question here..
The user name or password provided is incorrect. in MVC 3 Internet Application

吃颗糖壮壮胆 2024-09-06 13:55:26

您可能会遇到机器密钥不一致的情况。

在 web.config 中 - 隐式 machineKey 部分使用自动生成的加密和验证密钥,这些密钥再次根据应用程序 ID 进行键入 (AutoGenerate,IsolateApps)。

您是否正在使用不同的应用程序实例或另一台计算机进行测试?

Oracle 会员服务提供商是 2.0 还是 4.0?

这只是一次摸索,也许这会引导您找到解决方案。

来自 .NET Framework 4 迁移问题

成员资格类型

某些类型(例如 System.Web.Security.MembershipProvider)已从 System.Web.dll 移至 System.Web.ApplicationServices.dll 程序集。移动这些类型是为了解决客户端和扩展 .NET Framework SKU 中的类型之间的体系结构分层依赖关系。

从早期版本的 ASP.NET 升级并使用已移动的成员资格类型的类库在 ASP.NET 4 项目中使用时可能无法编译。如果是这样,请在类库项目中添加对 System.Web.ApplicationServices.dll 的引用

You may be experiencing machineKey disparity.

In web.config - the implicit machineKey section uses autogenerated encryption and validation keys that are again keyed against the app Id (AutoGenerate,IsolateApps).

Are you testing with a different application instance or on another machine?

Is the Oracle membership provider 2.0 or 4.0?

And this is just a stab in the dark, maybe this will lead you to a solution.

From .NET Framework 4 Migration Issues

Membership types

Some types (for example, System.Web.Security.MembershipProvider) that are used in ASP.NET membership have been moved from System.Web.dll to the System.Web.ApplicationServices.dll assembly. The types were moved in order to resolve architectural layering dependencies between types in the client and in extended .NET Framework SKUs.

Class libraries that have been upgraded from earlier versions of ASP.NET and that use membership types that have been moved might fail to compile when used in an ASP.NET 4 project. If so, add a reference in the class library project to System.Web.ApplicationServices.dll

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