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