Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Membership/Role providers for Postgres?

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?

like image 908
JeffG Avatar asked Jan 21 '11 13:01

JeffG


People also ask

What is the provider name for PostgreSQL?

Npgsql is a . Net data provider for PostgreSQL. It allows any program developed for . Net framework to access database server.

What is membership provider in asp net?

The ASP.NET membership provider is a feature that enables ASP.NET developers to create Web sites that allow users to create unique user name and password combinations. With this facility, any user can establish an account with the site, and sign in for exclusive access to the site and its services.

What is Npgsql in PostgreSQL?

Npgsql is an open source ADO.NET Data Provider for PostgreSQL, it allows programs written in C#, Visual Basic, F# to access the PostgreSQL database server. It is implemented in 100% C# code, is free and is open source.


1 Answers

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.

like image 128
joebarbere Avatar answered Oct 11 '22 07:10

joebarbere