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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Login Programically ( Error in DotNetNuke.Common.Utilities.XmlUtils )Login Programically ( Error in DotNetNuke.Common.Utilities.XmlUtils )
Previous
 
Next
New Post
5/8/2012 2:00 AM
 

I'm trying to customize login in for DNN 5.2.3.

 I'm using WIF ( Windows Identity Foundation ), I've added its reference and another website do the authentication for me. After authentication to user redirect to my DNN site and Context.User.Identity objects has been set and IsAuthenticated is set to true ( this is done by WIF engine ) , now I want to login by my own code.

Dim dnnUserInfo As New DotNetNuke.Entities.Users.UserInfo

dnnUserInfo = UserController.GetUserByName(PortalSettings.PortalId, Context.User.Identity.Name.Trim())

UserController.UserLogin(PortalSettings.PortalId, dnnUserInfo, PortalSettings.PortalName, Request.UserHostAddress, True)

 

but at UserLogin line the code thrown exception. dnnUserInfo object has been filled with correct value and it is not null but I get this exception:

 Object reference not set to an instance of an object

 at DotNetNuke.Common.Utilities.XmlUtils.GetAttributeValue(XPathNavigator nav, String AttributeName)
   at DotNetNuke.Common.Utilities.XmlUtils.GetAttributeValueAsInteger(XPathNavigator nav, String AttributeName, Int32 DefaultValue)
   at DotNetNuke.Common.Utilities.Config.GetPersistentCookieTimeout()
   at DotNetNuke.Entities.Users.UserController.UserLogin(Int32 portalId, UserInfo user, String PortalName, String IP, Boolean CreatePersistentCookie)
   at DotNetNuke.Framework.DefaultPage.Page_Load(Object sender, EventArgs e) in C:\Users\Mazoo\Desktop\Work\MYSTS\Default.aspx.vb:line 591
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

None of values in the method is NULL,

 

Regards

Mazdak

 
New Post
5/8/2012 2:05 AM
 

To add mroe decription:

 

When I check logs in database, it shows that login has been done successfully, but I don't know what is this error.

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Login Programically ( Error in DotNetNuke.Common.Utilities.XmlUtils )Login Programically ( Error in DotNetNuke.Common.Utilities.XmlUtils )


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