简体   繁体   English

自定义简单成员资格/ WebMatrix Websecurity? 是否可以抑制OAuth表? 删除密码字段?

[英]Customizing Simple Membership/WebMatrix Websecurity? Ability to suppress OAuth Tables? Delete password field?

I am working on a MVC4 website and have been working to customize the out-of-the-box SimpleMembershipProvider and have a few questions that I wasn't able to track down in the documentation. 我正在MVC4网站上工作,并且一直在自定义现成的SimpleMembershipProvider,并且有一些我无法在文档中找到的问题。

1) What kind of control can I have over the tables generated? 1)我可以对生成的表进行哪种控制? For instance, is there anyway to prevent OAuth tables from being generated if you will never be using OAuth? 例如,如果您永远不会使用OAuth,是否有任何方法可以阻止OAuth表的生成? Is it possible to simply have it work with a role field within the user table, rather than the default separate join tables? 是否可以简单地使它与用户表中的角色字段一起工作,而不是与默认的单独联接表一起工作?

2) Users will be authenticating via an external system. 2)用户将通过外部系统进行身份验证。 Is there anyway to override the Websecurity.Login(username, password) to simply be Webseurity.Login(username)? 无论如何,是否有将Websecurity.Login(用户名,密码)覆盖为Webseurity.Login(用户名)的方法?

Thanks in advance for any pointers or resources you can provide. 在此先感谢您可以提供的任何指针或资源。

The only tables you can modify is the UserProfile. 您只能修改的表是UserProfile。 Here are instructions on how to customize UserProfile in SimpleMembership . 这是有关如何在SimpleMembership中自定义UserProfile的说明

There is not a WebSecurity.Login method that only accepts the username. 没有一个仅接受用户名的WebSecurity.Login方法。 But you could get around this by just assigning everyone in the database the same internal password when you use WebSecurity.CreateUserAndAccount and then use that internal password when you use the Login method. 但是您可以通过在使用WebSecurity.CreateUserAndAccount时为数据库中的每个人分配相同的内部密码,然后在使用Login方法时使用该内部密码来解决此问题。

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

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