ASP.NET Membership/Role providers for Postgres?

瘦欲@ 提交于 2019-12-03 05:15:48

问题


I am creating an MVC site and would like to use the built in Membership and Roles for .Net. I'm using the the .Net Data Provider for Postgresql (Npgsql), but am having trouble defining the membership defaultProvider and Postgresql connection string to connect to my local database. Can anyone help?


回答1:


I have not verified this, but will be using it in a project soon. Hopefully I will have more info to follow, and it will "just work" :)

http://code.google.com/p/pgsqlprovider/

Hoping to use this software stack

Windows Server 2008
PostgreSQL
PostGIS
Castle ActiveRecord
NHibernate
NHibernate.Spatial
ASP.NET MVC 3 with Membership/Role providers

[FOLLOW UP]

I ran the NuGet command "Install-Package Nauck.PostgresSQLProvider" to install the PostgreSQL ASP.NET Membership Provider created by Daniel Nauck and Jason Sznol.

http://nuget.org/List/Packages/Nauck.PostgresSQLProvider

Project Home
http://dev.nauck-it.de/projects/aspsqlprovider

You'll need to run this SQL to create the membership tables:
http://dev.nauck-it.de/projects/aspsqlprovider/repository/revisions/master/changes/src/NauckIT.PostgreSQLProvider/DatabaseSchema.sql

Finally the web.config file will need to be updated... I used this example for direction:
http://dev.nauck-it.de/projects/aspsqlprovider/repository/revisions/master/entry/src/Example/Web.config

So far authentication works, as does hashed passwords, all thats left to test is authorization.




回答2:


I was a little frustrated with the nauck version, so I wrote my own. You can try it out here it you'd like. It has unit tests and a bit of documentation.



来源:https://stackoverflow.com/questions/4759195/asp-net-membership-role-providers-for-postgres

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!