I (and who use Window Authetication, I guest) have the same problem. Code in .\controls\DesktopPortalBanner.ascx.vb has some strange Dim UserId As Integer If Request.IsAuthenticated = True Then UserId = CType(Context.User.Identity.Name, Integer) Else UserId
= -1 End If Context.User.Identiry.Name is "DOMAIN\Username", I don't know how to convert it to integer?!
I had this exact same problem. I don't understand how Windows Authentication is working for anyone. I made a couple of changes: Fixed the error in web.config listed earlier in this thread. In controls DesktopPortalBanner.ascx.vb, I did the following. Seems
to work. Dim UserId As Integer If Request.IsAuthenticated = True Then 'Replace this UserId = CType(Context.User.Identity.Name, Integer) 'with Dim objUser As New UsersDB() Dim dr As SqlDataReader = objUser.GetSingleUserByEmail(_portalSettings.PortalId, Context.User.Identity.Name)
If dr.Read() Then UserId = dr("UserId") End If dr.Close() Else UserId = -1 End If ' Then in a couple of places below, replace '' If Context.User.Identity.Name = _portalSettings.SuperUserId Then 'with If UserId = _portalSettings.SuperUserId Then Does this seem
correct?
My last post was a bit premature. If you put that code in, it breaks forms authentication. It is also in many more places. Bottom line... with forms authentication, after succesful login, Context.User.Identity.Name will be set to UserId from the user table,
an integer. With Windows authentication, it is Domain\Username. Does anyone have this working with Windows Authentication ? I loaded and have been testing with 1.0.5. Most of the modules where this appears to be a problem dealing with the multiple portals.
"Context.User.Identity.Name <> _portalSettings.SuperUserId" is the most common one that looks like a problem.
Regardless of whether you use Windows or Forms authentication, the application is currently expecting your users to exist in the DotNetNuke database Users table. Then the global.asax.vb does the mapping of a username to a userid which is used internally throughout
the application. The original IBS portal handled Windows authentication this way as well. It is currently not possible to assign roles to a user unless the user is in the DB.
Thanks Shaun, I didn't fully understand that until I spent some more time in the code. I had put DomainName\Username into the Users table. Actually, this userid wasn't getting set in global.asax.vb because User.Identity.AuthenticationType is coming back "NTLM",
not "Windows". So, I copied the code in the Case statement from Case "Windows" to Case "NTLM" and everything is working now. DotNetNuke is great. Hope it continues to grow.
I'm having problems with this to. The code in global.asax.vb is very different between IBS and DNN and I haven't found a way around it. Basically, the app refers to Context.User.Identity.Name in numerous places; this is a read-only property that always appears
to contain the current user's Windows login name (NTDOMAIN\UserName) when Windows authentication is turned on. I haven't found anyway to change that security context and I'm hoping the answer isn't to replace it's usage all through the app.
Hi JRdotNet I've created a small component to handle Windows Authentical Mode with DNN 1.0.6 for my intranet. The process is: * On AuthenticateRequest: Check if user record exists in database * If user's not found in the database: Go to Windows Active Directory/Global
Catalog get all user info (firstnam, lastname, email...) * Add new user to database based on info from Active Directory * Add Group Membership (Roles) based on Security Groups of AD which user belonged to. With this function you could integrated security group
of Windows & Roles of DNN. This component's working OK in my intranet, but not fully test with other systems. If you want to try, give me your email address. Tam Tran Minh
tamttt, I'd like to try your component. skyy_sport@yahoo.comNOSPAM I was planning on something similar but, I haven't got the roles part correct yet. I had managed to use the component from the time tracker sample but never really got it right. Recommended
Reading: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=055FF772-97FE-41B8-A58C-BF9C6593F25E
Hi tamttt, Just coming up to speed on DotNetNuke. I've been tasked with integrating it with our current active directory and group policy. I would be very interested in looking at your component. Also curious how the Context.User.Identity.Name was addressed
globally when implementing windows authentication. A global find and replace for UserId leaves UserId undimensioned all over the place obviously wont compile. If you could send code it would be greatly appreciated.... bandit_193@hotmail.comASDF Thanks, JHaynes
tamttt
Contributor
2500 Points
500 Posts
Re: Windows Authentication
Mar 25, 2003 10:56 PM|LINK
tamttt
Contributor
2500 Points
500 Posts
Re: Windows Authentication
Mar 25, 2003 11:06 PM|LINK
RobBoone
Member
15 Points
3 Posts
Re: Windows Authentication
Apr 07, 2003 09:32 PM|LINK
RobBoone
Member
15 Points
3 Posts
Re: Windows Authentication
Apr 08, 2003 03:47 AM|LINK
sbwalker
Star
10239 Points
2051 Posts
ASPInsiders
MVP
Re: Windows Authentication
Apr 08, 2003 12:55 PM|LINK
CTO & Co-Founder
DotNetNuke Corporation
http://www.dotnetnuke.com
RobBoone
Member
15 Points
3 Posts
Re: Windows Authentication
Apr 08, 2003 03:46 PM|LINK
JRdotNet
Member
17 Points
4 Posts
Re: Windows Authentication
Apr 08, 2003 04:24 PM|LINK
tamttt
Contributor
2500 Points
500 Posts
Re: Windows Authentication
Apr 08, 2003 11:21 PM|LINK
gismapper
Member
90 Points
18 Posts
Re: Windows Authentication
Apr 09, 2003 11:41 AM|LINK
bandit_193
Member
15 Points
3 Posts
Re: Windows Authentication
Apr 09, 2003 05:07 PM|LINK