Vb.net Manually Log A User Into Dnn

Re: Retrieving User Info from DotNetNuke

May 14, 2006  Hi all, I'm trying to retrieve user info from DotNetNuke. Basically all I want to do is get the username of the person currently logged on to the site. If I log into my module I want to be able to.

Aug 10, 2005 07:08 PM|NateDawg|LINK

Can I get the password of a logged in user un-hashed so that I can use it and their username to log that user into a database?

I'm writing modules that interface to a company’s back-end database and I would like them (the user) to each log into that database so I can set permissions per-user rather than using one username and password to log into the database and funneling everyone across that connection. It would be nice if I could use the info of an already validated user to keep them from having to log-in a second time whenever they get to a page that interfaces with the database. BTW here's some background that might make a difference in the answer. I’m using:

Windows 2003 SP1

The server is the Active Directory primary domain controller.

Vb.net Manually Log A User Into Dnn

IIS 6.0

MS-SQL server 2000 SP4

DNN 3.1

And Tam’s Authentication & login modules

Using the username and password of a user that is in A.D. for DNN was quite nice and saves my users from having to have a log-in for there PC and the website, but now I would like it if there was a way of telling SQL server that when this authenticated user goes to this module say to delete data from the database it will use there username and password to connect to the database so that only users who I specify may delete data and if it becomes an issue with the manager and they ask me who deleted the data I can refer back to the SQL log file and find the username of the person who performed the deletion. (Not a problem yet, just trying to cover my own ;-)

For anyone not familiar with how tam’s authentication modules work, I’ll give a quick overview. When a user (who has a username and password already in Active Directory) goes to the portal for the first time and logs in using there windows username and password the module will authenticate it against Active Directory. At that point the user information is also stored in the DNN database. So the same username and password exist for the user in both A.D. and DNN. I don’t care were I get the password from as long as it will work to log the user into the SQL server, which uses Windows Authentication.

Any help would be appreciated.

Vb.net Manually Log A User Into Dnn Mail

Thanks, Nathan Rover

Vb.net Manually Log A User Into Dnn Email

Hi Bryan, Yeah that is correct, however I wouldn't necc say you are 'faking' the login as there is still authentication going on, in the sense that the creditials being passed will have to exist in DNN. In the past you could pass credentials via the url such as: someurl.com/login.asp?strUser=username&strPass=password However I doubt that you can do this with the signin.ascx as signin.ascx isn't a stand alone page. What I was thinking of doing was making a duplicate signin page but as an aspx that I could then maybe write a sub to look for something in the referring url. The signin.aspx would be called directly from the referring site, and once everything clicked on the new signin.aspx page you could be redirected to default.aspx in dnn. That is my current thinking anyways. As far as what you are wanting to do Bryan, I would say that the cookie wouldn't be of much use as I don't think that it keeps and maintains a user's logged in status. You could do a McGiver style tweak and use the users online module that does keep all of that info in a nice and tidy page and have your asp page reference that and do a lookup to see if they are logged in. Just a thought. -Ron