473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom membership provider - help needed

I need to implement a login system using Asp.net 2.0 login
module( membership provider) with password being case insensitive. I
wrote a class Accessmembershi pprovider.vb and below is my code.
Somehow, it does seem that the validate users logic is picking this
new code up. Can anyone tell me what I might have missed out?

Regards
=============== =============== =============== =====>
Imports Microsoft.Visua lBasic
Imports System.Data
Imports System.Web.Conf iguration
Imports System.Data.Sql Client

Public Class AccessMembershi pProvider
Inherits MembershipProvi der

Public Overrides Sub Initialize(ByVa l name As String, ByVal config
As System.Collecti ons.Specialized .NameValueColle ction)

End Sub

Public Overrides Property ApplicationName () As String
Get
End Get
Set(ByVal value As String)
End Set
End Property

Public Overrides Function ChangePassword( ByVal username As String,
ByVal oldPassword As String, ByVal newPassword As String) As Boolean

End Function

Public Overrides Function ChangePasswordQ uestionAndAnswe r(ByVal
username As String, ByVal password As String, ByVal
newPasswordQues tion As String, ByVal newPasswordAnsw er As String) As
Boolean

End Function

Public Overrides Function CreateUser(ByVa l username As String,
ByVal password As String, ByVal email As String, ByVal
passwordQuestio n As String, ByVal passwordAnswer As String, ByVal
isApproved As Boolean, ByVal providerUserKey As Object, ByRef status
As System.Web.Secu rity.Membership CreateStatus) As
System.Web.Secu rity.Membership User

End Function

Public Overrides Function DeleteUser(ByVa l username As String,
ByVal deleteAllRelate dData As Boolean) As Boolean

End Function

Public Overrides ReadOnly Property EnablePasswordR eset() As
Boolean
Get

End Get
End Property

Public Overrides ReadOnly Property EnablePasswordR etrieval() As
Boolean
Get

End Get
End Property

Public Overrides Function FindUsersByEmai l(ByVal emailToMatch As
String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef
totalRecords As Integer) As
System.Web.Secu rity.Membership UserCollection

End Function

Public Overrides Function FindUsersByName (ByVal usernameToMatch As
String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef
totalRecords As Integer) As
System.Web.Secu rity.Membership UserCollection

End Function

Public Overrides Function GetAllUsers(ByV al pageIndex As Integer,
ByVal pageSize As Integer, ByRef totalRecords As Integer) As
System.Web.Secu rity.Membership UserCollection

End Function

Public Overrides Function GetNumberOfUser sOnline() As Integer

End Function

Public Overrides Function GetPassword(ByV al username As String,
ByVal answer As String) As String

End Function

Public Overloads Overrides Function GetUser(ByVal username As
String, ByVal userIsOnline As Boolean) As
System.Web.Secu rity.Membership User

End Function

Public Overloads Overrides Function GetUser(ByVal providerUserKey
As Object, ByVal userIsOnline As Boolean) As
System.Web.Secu rity.Membership User

End Function

Public Overrides Function GetUserNameByEm ail(ByVal email As
String) As String

End Function

Public Overrides ReadOnly Property MaxInvalidPassw ordAttempts() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property
MinRequiredNonA lphanumericChar acters() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property MinRequiredPass wordLength() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordAttempt Window() As
Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordFormat( ) As
System.Web.Secu rity.Membership PasswordFormat
Get

End Get
End Property

Public Overrides ReadOnly Property
PasswordStrengt hRegularExpress ion() As String
Get

End Get
End Property

Public Overrides ReadOnly Property RequiresQuestio nAndAnswer() As
Boolean
Get

End Get
End Property

Public Overrides ReadOnly Property RequiresUniqueE mail() As
Boolean
Get

End Get
End Property

Public Overrides Function ResetPassword(B yVal username As String,
ByVal answer As String) As String

End Function

Public Overrides Function UnlockUser(ByVa l userName As String) As
Boolean

End Function

Public Overrides Sub UpdateUser(ByVa l user As
System.Web.Secu rity.Membership User)

End Sub

Public Overrides Function ValidateUser(By Val username As String,
ByVal password As String) As Boolean
Dim strconnectionSt ring As String =
WebConfiguratio nManager.Connec tionStrings("Lo calSqlServer"). ConnectionStrin g
Dim con As New SqlConnection(s trconnectionStr ing)

Try
con.Open()
Dim sql As String = "Select * From Membership WHERE " & _
"username=@user name AND password=@passw ord"
Dim comm As New SqlCommand(sql, con)
password = password.ToUppe r()
comm.Parameters .AddWithValue(" @username", username)
comm.Parameters .AddWithValue(" @password", password)
Dim reader As SqlDataReader = comm.ExecuteRea der
If reader.HasRows Then
Return True
Else
Return False
End If
con.Close()

Catch ex As Exception
Console.Write(e x.ToString)
Return False
End Try
End Function
End Class

Apr 30 '07 #1
0 1572

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2552
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called "Enlighten.LinkMad.Businesslogic". In one of my frontend websites I use this type to authenticate a user who is trying to login. The following excerpt is from the web.config of the particular site showing the reference to the custom provider, allowing .Net to do...
2
11790
by: WB | last post by:
Hi, I am revamping my company's website with ASP.Net 2.0. In order to use our existing user data in our SQL 2000, I have written a custom membership provider. However, when I try to logon with the Login control, it gives an error: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Is it because I have not run the aspnet_regsql.exe yet? Do I have to?
2
3559
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the custom membership provider fine and removes the security question/answer fields as designated in the custom provider. The problem is that when I try to create a new user in the create user wizard by entering the info and pressing the 'create...
4
2237
by: techsupport | last post by:
I have some experience with .NET Remoting, as well as ASP.NET 2.0, and have been wanting to remote a custom membership and profile provider. I want to take advantage of the new controls in ASP.NET 2.0 such as Login, Loginuser, Loginview, etc. The ASP.NET provider model requires entries in the web.config for a 'connectionStringName', which I understand is utilized to connect to the data source. Problem is the client machine (machine A)...
1
1412
by: Axford | last post by:
Hello, I am trying to implement my own custom provider for memberships, basically only id/pwd (no roles). I use the new login web control (I am using asp.net 2.0 and VS2005). In web.config I followed the examples like: <membership defaultProvider="AspNetSqlMembershipProvider2"> <providers> <clear/>
1
291
by: kvr901 | last post by:
I've been trying to use this "custom membership provider" stuff for several days, and am totally lost. I am building an ASP.NET (vb) application on a laptop. Then I copy the files to a Win 2003 Server machine. Just for testing I created a BLANK SQL Server 2000 database on the server (its only purpose it to try out using the membership stuff). I ran the aspnet_regsql thing and it created a bunch of tables and stored procedures...
0
2308
by: Mwob | last post by:
Hi all, I'm about to start creating a custom membership provider. Its for a website that already has a table of users in a single table, so I need to create a custom MP to talk to the data in that table. In addition, my custom membership provider needs to be able to do this: 1) Hash the password. 2) Verify the strength of the pasword when a user is created. I want to
4
1706
by: alexandis | last post by:
We have tables of logins (users), that differs much from standard microsoft structure - we don't use control question/answer, date fields, etc. But instead we have several additional fields. I expanded membership class and it works for logging in, but going further - creating user - I must make following in CreateUserWizard template: 1) create 'users' record filling standard microsoft fields and ignore those I don't use (mentioned...
3
1971
by: Sunfire | last post by:
I need to use a custom database for all of the user membership and rolls. How do you do this?
6
2931
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of questions come to mind. 1. How would one implement GetNumberOfUsersOnline? I'm not sure where there is any indication of this? And it this affected by the "Remember me next time" checkbox, which doesn't seem to work like it does on any other site...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.