Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...How to progammaticaly login a user?How to progammaticaly login a user?
Previous
 
Next
New Post
3/11/2015 11:41 AM
 

Hello!

I am trying to provide an one-click-login for a partner of ours.

I made a new page, where I added a new module which is a copy of DesktopModules\AuthenticationServices\DNN\Login.ascx

I am filling txtUsername & txtPassword with the values I want, and raise the OnLoginClick event at the end of the method.

Although is seems to work fine, user is authenticated, the code reaches OnUserAuthenticated(eventArgs) line, but nothing happens... I checked eventArgs contents, and are the same as when I am doing a normal login.

 

Any ideas?

 

DNN 7.03.02 (109)

 
New Post
3/11/2015 2:37 PM
Accepted Answer 
Are you sure your module inherits from UserModuleBase -if it doesn't then there is nothing to consume the event. Note: whilst using the UserModuleBase is best , often people simply call UserController.ValidaetUser to validate a user and then UserController.UserLogin to log them in

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/12/2015 4:21 AM
 
The module I am using is an exact copy of the DesktopModules\AuthenticationServices\DNN\Login.ascx, which inherits from AuthenticationLoginBase and then from UserModuleBase.
Events are called in the module, but the OnUserAuthenticated(eventArgs) method seems that does nothing...
 
New Post
3/12/2015 4:38 AM
 

Ok, found it. You were right (as always :D)

 UserController.ValidaetUser was already implemented, how ever UserController.UserLogin was not.

So I added the UserController.UserLogin, and now works!


Thank you.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...How to progammaticaly login a user?How to progammaticaly login a user?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out