Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline vikasoft  
#1 Posted : Tuesday, July 12, 2016 10:57:00 PM(UTC)
vikasoft


Rank: YAF Forumling

Reputation:

Joined: 7/12/2016(UTC)
Posts: 2
United States

I have my references and web.config set. I'm using the YAF providers. When I validate the user, if it's invalid it passes back false just fine. But if the login is valid, I get the "Object reference not set to an instance of an object".

Another odd thing is that I have to specify the ApplicationName in code, even though it is listed in the provider settings for the web.config:

<membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
<providers>
<clear />
<add name="YafMembershipProvider" applicationName="WebsiteIntegration" connectionStringName="yafnet"
requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider" />
</providers>
</membership>

Code:
Dim ymp As New YafMembershipProvider
ymp.ApplicationName = "WebsiteIntegration"
Dim test = ymp.ValidateUser(txtUsername.Text, txtPassword.Text)

Properties of the object also have the useSalt property set to false. So, I'm thinking the web.config isn't being read correctly?

Thanks,

-m
Sponsor
Offline vikasoft  
#2 Posted : Tuesday, July 12, 2016 11:12:02 PM(UTC)
vikasoft


Rank: YAF Forumling

Reputation:

Joined: 7/12/2016(UTC)
Posts: 2
United States

Classic case of overthinking it. The default provider is overwritten by YAF, so just use the built in System.Web.Security functions.

Working now. Carry on.

-m
Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error