Last post Dec 20, 2005 11:42 AM by dickies
Dec 16, 2005 11:27 AM|dickies|LINK
I'm running 3.1.0 and want to add another application in a subfolder like
http://localhost/Dotnetnuke/NewApp. The NewApp has its own web.config file. I wany NewApp to be able to use the same Forms Authentication as DNN, so whenever I login to DNN I am automatically logged into NewApp.
I know this is something I haven't done in web.config (either DNN web.config or NewApp web.config).
Can someone help me out with this please? Once I have it working I can then use multiple apps with the same authentication.
Dec 17, 2005 05:48 AM|dickies|LINK
Dec 17, 2005 08:54 AM|dickies|LINK
Dec 18, 2005 06:09 PM|dickies|LINK
Dec 18, 2005 06:47 PM|portvista|LINK
Dec 19, 2005 03:50 AM|dickies|LINK
Dec 20, 2005 07:22 AM|dickies|LINK
I've made a bit of progress on this. I can read the cookie and write out the roles collection in my 2nd app. I'm not inheriting any dlls from DNN, just accessing the cookie. The code below is on default.aspx Page_Load in the 2nd app.
lblMsg.Text = Context.User.Identity.Name
lblMsg.Text &= "<li>" & strKey & "=" & Request.Cookies(strKey).Value
lblMsg.Text &= "<li>" & role
lblMsg.Text = "nichts"
I have 2 windows open in localhost. One logged in as Admin in DNN, the other hitting a default.aspx on the 2nd app. Using the above code, I can always print the string 'admin' in the 2nd app, which means I'm always authenticated while
I'm logged into DNN. However, if I leave it a while and refresh the 2nd app default.aspx, then cookie details are no longer there, only 'admin', which means I'm still logged into DNN, but no cookie collection!! Odd.
Can anyone comment on this and help me continue trying to access the cookie details from DNN if I'm in a 2nd app in a subfolder of DNN.
Dec 20, 2005 07:57 AM|workcontrol|LINK
It could be that the cookie is timed out. Even if you check the Remember me when log in to DNN, this is for DNN app. Perhaps you need code in your app dedect not IsAuthenticated then redirect to a DNN page the has the Account Login control.
Dec 20, 2005 08:12 AM|dickies|LINK
Dec 20, 2005 11:42 AM|dickies|LINK
My tests show that it always gets passed IsAuthenticated, because it always prints 'admin' as the context.user.identity.name in the 2nd app. This is because I have not logged out of DNN. However, it looks like the cookie drops out. So you might be right
about the cookie timing out, but it still looks to me like the user gets passed the Forms Auth (i.e. IsAuthenticated = True).