degree11
  •  degree11
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
2020-10-26T18:08:30Z
I'm new to yaf.NET and I am trying to figure out how the login and authentication work.

I can't see much resources about it or the threads are ancient. I am running the newest source c ode version.

I tried to debug but it doesn't seem to hit login.aspx.cs or signin method at all.

I can see it uses Logout.aspx.cs on logout, but not the above login.

Can you point me in to the right direction please?

Ultimately I want to replace buil-in login with our website membership provider so need to figure out how it works on yaf.NET initially.

An advice how to set it up would be welcomed too.

Thanks
Sponsor
tha_watcha
2020-10-27T08:21:06Z
What exactly is the problem? If you want to login the user in to the forum you need to use the forums login page, then it will use the membership provider of your existing site and creates the forum user automatically.
UserPostedImage
degree11
  •  degree11
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
2020-10-27T09:53:43Z
.1 The problem is that I don't know how the authentication works because I am unable to find login classes that are getting hit by the debugger.

2. Also the problem is that I do not know how to replace the existing YAF authentication by our own one - because I am unable to find where the authentication happens in YAF source code - see first problem above.
tha_watcha
2020-10-28T08:45:54Z
Originally Posted by: degree11 

.1 The problem is that I don't know how the authentication works because I am unable to find login classes that are getting hit by the debugger.

2. Also the problem is that I do not know how to replace the existing YAF authentication by our own one - because I am unable to find where the authentication happens in YAF source code - see first problem above.



Not sure if i can really help you.. But if you looking for the login it is don in the login.ascx.cs or the LoginBox.ascx.cs.

UserPostedImage
degree11
  •  degree11
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
2020-10-29T09:53:58Z
Yeah, I've already found LoginBox so can debug but still not sure how to integrate with custom authentication.

One of the features listed on the YAF home page is "YAF.NET forum is an embeddable (ascx) user-control and supports ASP.NET Membership making integration into DNN, MojoPortal, Umbraco, SharePoint and custom solutions possible." but there seem not to be any sort of documentation how to actually do it.
tha_watcha
2020-10-29T10:08:09Z
Originally Posted by: degree11 

Yeah, I've already found LoginBox so can debug but still not sure how to integrate with custom authentication.

One of the features listed on the YAF home page is "YAF.NET forum is an embeddable (ascx) user-control and supports ASP.NET Membership making integration into DNN, MojoPortal, Umbraco, SharePoint and custom solutions possible." but there seem not to be any sort of documentation how to actually do it.



Yes i know that, but be aware that this is an open source community software forum. I cant do everything alone here. And i can only provide solutions for solutions i know like dnn, where a module exist for yaf.

But if you your website is using the old classic asp.net membership then integrating would be possible relatively easy because then yaf uses the membersip provider defined in the web.config.

There also exist the YAF.Sample Application which is a basic example of how to integrate yaf in to a existing website.

Other then that without knowing the website or the cms (if any is used) i cant help much.


UserPostedImage
degree11
  •  degree11
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
2020-11-13T15:30:32Z
So how to use our custom membership?
Just replace membership provider in web.config?

We basically added our membership provider and made it default provider which works fine (our membership users can login on the forum) except that:

this.PageContext.CurrentUserData.Membership

is null so My Account page throws runtime error when trying to read membership user email etc.

And also I've been trying to add our user to give admin rights but it doesn't work -
see my post here

https://www.yetanotherfo...et-admin-in-the-database 

- the user is not seen as admin.
degree11
  •  degree11
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
2020-11-17T15:30:31Z
I've fixed the My account page access by adding a line in CombinedUserDataHelper in MembershipUser property:


                if(this.membershipUser == null)
                {
                    this.membershipUser = System.Web.Security.Membership.GetUser();
                }
tha_watcha
2020-11-18T12:18:01Z
Originally Posted by: degree11 

I've fixed the My account page access by adding a line in CombinedUserDataHelper in MembershipUser property:


                if(this.membershipUser == null)
                {
                    this.membershipUser = System.Web.Security.Membership.GetUser();
                }



If the Membership User is null at this point then it means that user Membership Provider returns null for the current User on the Method MembershipUser GetUser(string username, bool userIsOnline)
UserPostedImage

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved