CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.portal_starter_kit Tags:
Item Type: NewsGroup Date Entered: 3/27/2003 10:47:52 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
jeff dickerson
Asp.Net User
Windows Authentication and Roles3/27/2003 10:47:52 PM

0/0

I was able to get windows authentication working, but it seems that the web application was sending the NT domain and the username as the email address (GetRolesByUser function in Security.vb). This wouldn't be a problem if you could enter an email address that matched what was being sent by the GetRolesByUser.

I found if I tried to enter 'domain\username' in the email address a web error would occur because of the '\'. I tried everything I could think of and finally ended up solving it by modifying the GetRolesByUser SPROC to strip the domain and the backslash out of the @email variable that is passed to it before the database is queried for the roles. Here is the modified code to the sproc:

/* returns all roles for the specified user */
ALTER PROCEDURE GetRolesByUser
(
@Email nvarchar(100)
)
AS

--Remove the NT domain name and back slash from @email
--(i.e. change 'domain\username' to 'username'
DECLARE @position INT
SET @position = 0
WHILE @position <= DATALENGTH(@email)
BEGIN
IF (ASCII(SUBSTRING(@email, @position, 1)) = 92) --Looks for the '\' character
BEGIN
SET @email = (SUBSTRING(@email, @position + 1, DATALENGTH(@email)))
BREAK
END
ELSE
SET @position = @position + 1
END

--Existing code
SELECT
Roles.RoleName,
Roles.RoleID

FROM
UserRoles
INNER JOIN
Users ON UserRoles.UserID = Users.UserID
INNER JOIN
Roles ON UserRoles.RoleID = Roles.RoleID

WHERE
Users.Email = @Email

Once this is put in place of the original SPROC, you enter the NT username (without the domain or backslash) in the email test field with no password, save and then assign the role you want to the new user.

I hope there isn't some easy setting I missed that will allow the roles to work with NT authentication, but I couldn't find anything in the docs or the posts. Let me know if this helps you....

Jeff
CiscoWzrd
Asp.Net User
Re: Windows Authentication and Roles5/26/2003 1:34:52 PM

0/0

Prefer simpler solution:
Change SPROC to match "Name" Column to passed parameter "@Email"

CREATE PROCEDURE GetRolesByUser
(
@Email nvarchar(100)
)
AS

SELECT
Roles.RoleName,
Roles.RoleID

FROM
UserRoles
INNER JOIN
Users ON UserRoles.UserID = Users.UserID
INNER JOIN
Roles ON UserRoles.RoleID = Roles.RoleID

WHERE
Users.Name = @Email
GO


Of course I've had to DASM/ASM ASPNETPortal.DLL, and mane SPROC's to get all the Table & Column names to match CASE.

PS (to Microsoft): Not everybody uses "CASE INSENSITIVE" on SQL servers.
JZ_
Asp.Net User
Re: Windows Authentication and Roles9/28/2004 4:13:13 PM

0/0

I found an even easier solution.

I used Server.UrlEncode() to encode the backslash character in all instances of Email.Text and UserName in the following files:

ManageUsers.aspx
users.ascx

My next task is to find a way to automatically assign a default role and create a user ID for all domain users upon first login. Has anyone tried?
leatheric
Asp.Net User
Re: Windows Authentication and Roles4/8/2005 9:18:13 AM

0/0

I am new to this, can you show me exactly where are the changes to be made.

I tried chainging it using web matrix and after that  when i click on Add New User at the Manage User, i get a Runtime error.

Next, I also found some problem with the change password function.the password does not get encrypted, it just update the password field at the database in ASCII.

After changing the password, i try to login, it will never work. I have to copy the hexadecimal password from the guest account to overwrite and then login with the password "guest" in order to get in.

 

 

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
Microsoft SQL Server 2000: A Guide to Enhancements and New Features Authors: Rahul Sharma, Pages: 592, Published: 2002
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Professional DotNetNuke 4: Open Source Web Application Framework for ASP.NET 2.0 Authors: Shaun Walker, Joe Brinkman, Bruce Hopkins, Scott McCulloch, Patrick J. Santry, Chris Paterra, Scott Willhite, Dan Caron, Pages: 517, Published: 2006
SQL Server Security: covers SQL Server 2000 and SQL Server 7 security Authors: Chip Andrews, David Litchfield, David (David William) Litchfield, Bill Grindlay, Pages: 352, Published: 2003
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
SQL Server 2005 T-SQL Recipes: A Problem-Solution Approach Authors: Joseph Sack, Pages: 733, Published: 2005
Building Portals, Intranets, and Corporate Web Sites Using Microsoft Servers Authors: James J. Townsend, Dmitri Riz, Deon Schaffer, Pages: 517, Published: 2004
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006

Web:
Windows Authentication with Role based authorization - ShowUsYour ... “out-of-hours” that needed to use integrated Windows authentication and also use Role based authorization based on the users Windows Group membership. ...
Working with Roles and Windows Authentication - -[Danny Chen ... Apr 19, 2005 ... The Web Admin Tool allows web-admins to create users, create roles, put users in roles, and it's done. But with Windows Authentication, ...
How To: Use Windows Authentication in ASP.NET 2.0 When you use Windows authentication, user names take the form domainName\ userName. Windows groups are used as roles and they take the form ...
ASP.NET 2.0 Intranet - Windows Authentication, SQL Roles ... Windows authentication; AD user store; SQL Server role store ... NET is configured for Windows authentication ...
CodeProject: Extending Forms Authentication - Windows or Custom ... All you have to do is extend these classes and add your custom authentication and roles, or if you are using Windows authentication, just add your custom ...
Integrated windows authentication and roles - technical discussion ... Hello, I'm new to .NET technology and am trying to figure out how to implement integrated Windows authentication. I have a .NET framework set up with IIS ...
How To: STS/Windows Authentication with ADAM/AD, Roles in AzMan ... I no have Single-Sign on Windows/Kerberos Authentication together with AD/ADAM for WCF services with Role Based Security roles in AzMan! ...
patterns & practices: WCF Security Guidance - Home In the scenario described in this How To article, users are authenticated against their Windows domain account and authorized against roles in the SQL ...
Windows authentication, roles, newby ques - ng.asp-net-forum ... Windows authentication, roles, newby ques, > ROOT > NEWSGROUP > Asp.Net Forum > general_asp.net.security, Date: 4/5/2006 2:30:32 PM, Replies: 0, Views: 8, ...
mojoPortal - Using Windows Authentication To use Windows Authentication with mojoPortal, your Web server must be on ... it does not use windows roles, so when I login using my windows login I need ...

Videos:
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...
Developing Win Apps w/ Visual Studio.NET Level 5 The Developing Win Apps w/ Visual Studio.NET Level 5 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based informati...




Search This Site:










datagrid(w/paging) - after edit how to go back to correct page?help!

let's go off topic and wish everyone of the ibs users ...

roles security at host -- genericprincipal problem

pdf display module

help with portalcfg.xml

management of module files

delete confirmation window

adding portal to asp.net project

the trouble with tribbles [err modules]

error installing portal

installation problem

annoucenment: mowog.userlistmanager

domain login message box problem

please help in active directory

application_beginrequest performance impact

windows authentication question

secure ibs installation

how to use images for tabs

checkbox validation ?

ibuyspy portal vb install problem

how come its so hard to make a solution file that works?

ibuyspy hosting problem(web.config&access db)

security issue - registering as new user

new user login fails

install problem, please help!

page not found error instead of debugging

trouble with registration page

how to add ngallery into the portal

site management systems

data access methods

  Privacy | Contact Us
All Times Are GMT