What is the best way to handle authentication in ASP.NET MVC with a Universe database?
Asked Answered
S

3

3

We use an IBM database known as Universe that holds all of our user id's, passwords, and profile information in a table called USERINFO.

Can I use the Membership Provider to connect to this database and authenticate the user?

The database access is actually through a web service since we don't have a direct connect to the database.

We have a web service method called GetUserInfo which accepts a parameter of username. The method will return the password and profile information.

Shorthand answered 16/9, 2008 at 12:18 Comment(0)
K
10

As mentioned above, you'll need to create a custom membership provider which a fairly straightforward. You'll create a .NET class that inherits from System.Web.Security.MembershipProvider. There are several methods that need to be overriden in your class, but most are not even used by the MVC account controller. The main method you'll want to override is ValidateUser(username, password) which will get a user logged in. After you've implemented your class you'll need to register it in web.config which is easy as well.

You can find a sample for a custom provider here: http://msdn.microsoft.com/en-us/library/6tc47t75(VS.80).aspx

And a tutorial for the entire process here: http://www.15seconds.com/issue/050216.htm

Keep in mind that the process for making a custom provider for MVC is the same for a standard ASP.NET web site, however MVC does not fully utilize all methods of the MembershipProvider class so it's much easier to implement.

Kalila answered 16/9, 2008 at 12:56 Comment(0)
A
0

You'll have to create a custom provider for that. It isn't very hard, as long as you can access the web service without an issue.

Airy answered 16/9, 2008 at 12:20 Comment(0)
M
0

Have you investigated the UniObjects interface? It comes with Universe, but needs to be installed. It has complete access to all database functions. Logging in, Selecting files, reading, writing, deleteing, creating new files etc.

Microclimatology answered 29/11, 2008 at 22:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.