Windows Authenticationhttp://forums.asp.net/t/157165.aspx/1?Windows+AuthenticationThu, 03 Nov 2005 17:10:11 -0500157165157165http://forums.asp.net/p/157165/157165.aspx/1?Windows+AuthenticationWindows Authentication Sean, I paid the $30 and am happy to offer it as a contribution to your effort. Thanks again. WRT Windows Authtentication, I'm having trouble implementing it. You mention in the email that you sent out that it is based on the original IBuySpy Implentation. Can I look to the threads on the original IBuySpy for assistance? The problem that I'm having is that I can't seem to implement the Roles. Admin tab is not showing up for the users in the Admin Role, etc. Thanks 2003-02-26T09:38:30-05:00157265http://forums.asp.net/p/157165/157265.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication Sean, One other point... when I use the tag , I'm getting an error that says Unrecognized tag 'identity' in the config file. I am able to authenticate using what's suggested in the original IBuySpy: But I can't get authorization to work. Thanks in advance. 2003-02-26T11:50:08-05:00158160http://forums.asp.net/p/157165/158160.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication I used, Also, I was having problems with the following code section in the Application_AuthenticateRequest method. The problem is that Context.User.Identity.AuthenticationType is Negotiate in this method. Dim intUserId As Integer Select Case User.Identity.AuthenticationType Case "Forms" intUserId = Int32.Parse(Context.User.Identity.Name) Case "Windows" Dim objUser As New UsersDB() Dim dr As SqlDataReader = objUser.GetSingleUserByEmail(_portalSettings.PortalId, Context.User.Identity.Name) If dr.Read() Then intUserId = dr("UserId") End If dr.Close() End Select Anyone else have this problem? 2003-02-26T23:17:59-05:00158647http://forums.asp.net/p/157165/158647.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication I am also having problems with this:-( Changing ,Case "Windows", to, Case "Negotiate", made it connect ok with WinXP and Win2003server beta but not w2k. I made a temp fix setting the case to Case Else. Now it seems to work fine for all clients. It would be good though if the log off button diapeard when in windows mode. In my webconfig I have put it like this: 2003-02-27T12:16:58-05:00158801http://forums.asp.net/p/157165/158801.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication Johnathan, In my case I had to change Case to NTLM on the Global.asax page. Additionally, I think a source of your problem is that you are not using impersonation. If you don't, ASP.Net runs under the local ASPNET user account, or in my case, since I'm on a Domain controller w/o local accounts, the account I specified in Machine.config. I finally got impersonation to work. In Shauns code, is an element contained in the element. It should NOT be nested. It should be seperate. I'm put together a small aspx page that Shows what Authentication method is being used, what account you are logged in as and what account ASP.Net is running under. If you want me to email it to you, just send me your address. Good luck. 2003-02-27T14:21:43-05:00159256http://forums.asp.net/p/157165/159256.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication don't change the case statement to check for negotiate. Replace it with this code: If TypeOf Context.User.Identity Is WindowsIdentity Then Dim objUser As New UsersDB() Dim dr As SqlDataReader = objUser.GetSingleUserByEmail(_portalSettings.PortalId, Context.User.Identity.Name) If dr.Read() Then intUserId = dr("UserId") End If dr.Close() Else intUserId = Int32.Parse(Context.User.Identity.Name) End If this is tested and works better Glen 2003-02-27T23:09:20-05:00159335http://forums.asp.net/p/157165/159335.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication Glen, That seems much better structured, this should probably be a fix in the next release. Thanks for the help. 2003-02-28T01:16:26-05:00159916http://forums.asp.net/p/157165/159916.aspx/1?Windows+AuthenticationWindows Authentication The hypUser link does not appear even after applying the changes listed in the other thread. Anyone else experiencing this? I'm trying to decipher what happens in the global.asax. I only intend on using this in an intranet environment so I'm trying to separate what's needed for forms vs. windows authentication. Any guidence appreciated. 2003-02-28T17:22:45-05:00177977http://forums.asp.net/p/157165/177977.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication Once Windows Authentication is running how do you specify the link between Groups and Roles? Is it as simple as creating a Role like Domain\Group. I've been struggling with this for a couple of weeks (really only for a few hours here and there). DB issues have been resolved, thank goodness. Currently I'm researching the following. I thought it was the Global.asax in the select statement but I haven't been able to solve this as of yet. Has anyone else seen this? Thanks Server Error in '/DotNetNuke' Application. -------------------------------------------------------------------------------- Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +166 Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +97 [InvalidCastException: Cast from string "RA-PCMAIN\PCouch" to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +212 DotNetNuke.DesktopPortalBanner.Page_Load(Object sender, EventArgs e) +2194 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +29 System.Web.UI.Control.LoadRecursive() +92 System.Web.UI.Control.LoadRecursive() +92 System.Web.UI.Control.LoadRecursive() +92 System.Web.UI.Page.ProcessRequestMain() +724 2003-03-22T10:36:08-05:00179260http://forums.asp.net/p/157165/179260.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication I just got to the same situation today. I just posted the same problem. Still looking for an answer. 2003-03-25T12:18:22-05:00179854http://forums.asp.net/p/157165/179854.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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?! 2003-03-25T22:56:57-05:00179863http://forums.asp.net/p/157165/179863.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication Hi ba-insight I need your aspx page Please send to tam@tttcompany.com Thanks 2003-03-25T23:06:46-05:00189491http://forums.asp.net/p/157165/189491.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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? 2003-04-07T21:32:54-04:00189619http://forums.asp.net/p/157165/189619.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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. 2003-04-08T03:47:20-04:00189917http://forums.asp.net/p/157165/189917.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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. 2003-04-08T12:55:10-04:00190106http://forums.asp.net/p/157165/190106.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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. 2003-04-08T15:46:10-04:00190140http://forums.asp.net/p/157165/190140.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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. 2003-04-08T16:24:11-04:00190477http://forums.asp.net/p/157165/190477.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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 2003-04-08T23:21:36-04:00190806http://forums.asp.net/p/157165/190806.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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 2003-04-09T11:41:34-04:00191176http://forums.asp.net/p/157165/191176.aspx/1?Re+Windows+AuthenticationRe: Windows Authentication 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 2003-04-09T17:07:17-04:00