How would i go about using windows authentication to determine whether
someone was in a active directory group, and if they were the page would
display something different.
For instance, when someone goes to my default.asp page, only people within
the "ContactAdmins" group would see the admin links, and other people would
not!
Please help me! :)
--
Mark 8 2043
It depends on how you implement your menu. Are you planning to use the
ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security
The Personal Web Site Starter Kit is a good demonstration. You can create
one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a
database (where each record stores the roles to which this menu item is
available). There are 2 aspects to handle: 1) the display of the menu item,
2) the access authority to the folder or file where the menu item is linked.
--
[note: if this post answers your question, you can mark it as an answer
using the web-based newsreader functions]
-----
HTH,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote: How would i go about using windows authentication to determine whether someone was in a active directory group, and if they were the page would display something different.
For instance, when someone goes to my default.asp page, only people within the "ContactAdmins" group would see the admin links, and other people would not!
Please help me! :)
-- Mark
Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then
response.write(secure stuff)
else
response.write("")
end if
Determining whether that user has permission is the part i want to be able
to do. For instance get a list of the users in the ContactAdmin Active
Directory group, and compare the currently logged in user to see if he is in
the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
--
Mark
"Phillip Williams" wrote: It depends on how you implement your menu. Are you planning to use the ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security The Personal Web Site Starter Kit is a good demonstration. You can create one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a database (where each record stores the roles to which this menu item is available). There are 2 aspects to handle: 1) the display of the menu item, 2) the access authority to the folder or file where the menu item is linked.
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
How would i go about using windows authentication to determine whether someone was in a active directory group, and if they were the page would display something different.
For instance, when someone goes to my default.asp page, only people within the "ContactAdmins" group would see the admin links, and other people would not!
Please help me! :)
-- Mark
Hi Mark,
1- in the web.config add the following segment:
<location path="SecureFolder">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="Admins"/>
</authorization>
</system.web>
</location> http://msdn.microsoft.com/library/de...gngrfAllow.asp
2- In the global.ascx authenticate the user against the LDAP
3- Createa custom principle (or choose any of the other authentication
methods) http://msdn.microsoft.com/library/de...secnetht04.asp
4- Modify the global.ascx to assign the Context.Current.User =
YourCustomPrincipal or a generic principel as in this sample: http://66.129.71.130/QuickStartv20/u...vb\global.asax
This should take care of both the display and security as in this sample: http://66.129.71.130/QuickStartv20/a....aspx#security
--
[note: if this post answers your question, you can mark it as an answer
using the web-based newsreader functions]
-----
HTH,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote: Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
It depends on how you implement your menu. Are you planning to use the ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security The Personal Web Site Starter Kit is a good demonstration. You can create one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a database (where each record stores the roles to which this menu item is available). There are 2 aspects to handle: 1) the display of the menu item, 2) the access authority to the folder or file where the menu item is linked.
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
How would i go about using windows authentication to determine whether someone was in a active directory group, and if they were the page would display something different.
For instance, when someone goes to my default.asp page, only people within the "ContactAdmins" group would see the admin links, and other people would not!
Please help me! :)
-- Mark
That example would just deny access to the whole page, which i could do
through NTFS permissions.
What i want is to just allow certain users (with permissions) to get links
on a page.
For instance, normal users just get a main menu page, however users with
permissions get the same main menu page, however they get an admin link in
the corner where they can get to the admin page. But i only want that link
displayed if they have permissions
Thanks for the help
--
Mark
"Phillip Williams" wrote: Hi Mark,
1- in the web.config add the following segment: <location path="SecureFolder"> <system.web> <authorization> <deny users="*"/> <allow roles="Admins"/> </authorization> </system.web> </location> http://msdn.microsoft.com/library/de...gngrfAllow.asp 2- In the global.ascx authenticate the user against the LDAP 3- Createa custom principle (or choose any of the other authentication methods) http://msdn.microsoft.com/library/de...secnetht04.asp
4- Modify the global.ascx to assign the Context.Current.User = YourCustomPrincipal or a generic principel as in this sample:
http://66.129.71.130/QuickStartv20/u...vb\global.asax
This should take care of both the display and security as in this sample: http://66.129.71.130/QuickStartv20/a....aspx#security
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
It depends on how you implement your menu. Are you planning to use the ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security The Personal Web Site Starter Kit is a good demonstration. You can create one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a database (where each record stores the roles to which this menu item is available). There are 2 aspects to handle: 1) the display of the menu item, 2) the access authority to the folder or file where the menu item is linked.
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
> How would i go about using windows authentication to determine whether > someone was in a active directory group, and if they were the page would > display something different. > > For instance, when someone goes to my default.asp page, only people within > the "ContactAdmins" group would see the admin links, and other people would > not! > > Please help me! :) > > -- > Mark
Hi Mark,
Are you saying that you want to give access to a page for users whose
permission does not allow them to see a link for it on the menu of the page?!
Perhaps you meant that from the home page of the site (which is allowed to
all users) you want only to display the menu items for the pages that are
authorized for the user. Both the example I gave its link below and the
Personal Web Site Starter Kit in ASP.NET2.0 do just that.
Phillip
"Mark" wrote: That example would just deny access to the whole page, which i could do through NTFS permissions.
What i want is to just allow certain users (with permissions) to get links on a page.
For instance, normal users just get a main menu page, however users with permissions get the same main menu page, however they get an admin link in the corner where they can get to the admin page. But i only want that link displayed if they have permissions
Thanks for the help
-- Mark
"Phillip Williams" wrote:
Hi Mark,
1- in the web.config add the following segment: <location path="SecureFolder"> <system.web> <authorization> <deny users="*"/> <allow roles="Admins"/> </authorization> </system.web> </location> http://msdn.microsoft.com/library/de...gngrfAllow.asp 2- In the global.ascx authenticate the user against the LDAP 3- Createa custom principle (or choose any of the other authentication methods) http://msdn.microsoft.com/library/de...secnetht04.asp
4- Modify the global.ascx to assign the Context.Current.User = YourCustomPrincipal or a generic principel as in this sample:
http://66.129.71.130/QuickStartv20/u...vb\global.asax
This should take care of both the display and security as in this sample: http://66.129.71.130/QuickStartv20/a....aspx#security
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
> It depends on how you implement your menu. Are you planning to use the > ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques? > > For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: > http://66.129.71.130/QuickStartv20/a....aspx#security > The Personal Web Site Starter Kit is a good demonstration. You can create > one by selecting File->new->Website->Personal Web Site Starter Kit. > > In one implementation using ASP.NET 1.x I had the menu entries saved in a > database (where each record stores the roles to which this menu item is > available). There are 2 aspects to handle: 1) the display of the menu item, > 2) the access authority to the folder or file where the menu item is linked. > > -- > [note: if this post answers your question, you can mark it as an answer > using the web-based newsreader functions] > ----- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "Mark" wrote: > > > How would i go about using windows authentication to determine whether > > someone was in a active directory group, and if they were the page would > > display something different. > > > > For instance, when someone goes to my default.asp page, only people within > > the "ContactAdmins" group would see the admin links, and other people would > > not! > > > > Please help me! :) > > > > -- > > Mark
I missed the part of how to determine whether the user has permission.
1) Set the security of the web app in IIS to “Integrated Windows
Authentication”
2) In the global.ascx, retrieve the userID from the Context.User.Identity.Name
3) Search the Active Directory for the user's information http://support.microsoft.com/default...b;en-us;326340
Notice that you need to query the directory using a hard-coded user id and
password if you are on Win 2K or to turn on Kerberos authentication if you
are on win server 2003 http://www.microsoft.com/windowsserv...s/default.mspx
--
[note: if this post answers your question, you can mark it as an answer
using the web-based newsreader functions]
-----
HTH,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote: Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
It depends on how you implement your menu. Are you planning to use the ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security The Personal Web Site Starter Kit is a good demonstration. You can create one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a database (where each record stores the roles to which this menu item is available). There are 2 aspects to handle: 1) the display of the menu item, 2) the access authority to the folder or file where the menu item is linked.
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
How would i go about using windows authentication to determine whether someone was in a active directory group, and if they were the page would display something different.
For instance, when someone goes to my default.asp page, only people within the "ContactAdmins" group would see the admin links, and other people would not!
Please help me! :)
-- Mark
Thank you very much for the help Philip, i have got it all sorted and working
now! :)
Regards
--
Mark
"Phillip Williams" wrote: I missed the part of how to determine whether the user has permission.
1) Set the security of the web app in IIS to “Integrated Windows Authentication” 2) In the global.ascx, retrieve the userID from the Context.User.Identity.Name 3) Search the Active Directory for the user's information http://support.microsoft.com/default...b;en-us;326340
Notice that you need to query the directory using a hard-coded user id and password if you are on Win 2K or to turn on Kerberos authentication if you are on win server 2003 http://www.microsoft.com/windowsserv...s/default.mspx
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
It depends on how you implement your menu. Are you planning to use the ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques?
For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: http://66.129.71.130/QuickStartv20/a....aspx#security The Personal Web Site Starter Kit is a good demonstration. You can create one by selecting File->new->Website->Personal Web Site Starter Kit.
In one implementation using ASP.NET 1.x I had the menu entries saved in a database (where each record stores the roles to which this menu item is available). There are 2 aspects to handle: 1) the display of the menu item, 2) the access authority to the folder or file where the menu item is linked.
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
> How would i go about using windows authentication to determine whether > someone was in a active directory group, and if they were the page would > display something different. > > For instance, when someone goes to my default.asp page, only people within > the "ContactAdmins" group would see the admin links, and other people would > not! > > Please help me! :) > > -- > Mark
You are quite welcome, Mark. It is a pleasure to see the information I have
on a topic being of help to others.
Regards,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote: Thank you very much for the help Philip, i have got it all sorted and working now! :)
Regards
-- Mark
"Phillip Williams" wrote:
I missed the part of how to determine whether the user has permission.
1) Set the security of the web app in IIS to “Integrated Windows Authentication” 2) In the global.ascx, retrieve the userID from the Context.User.Identity.Name 3) Search the Active Directory for the user's information http://support.microsoft.com/default...b;en-us;326340
Notice that you need to query the directory using a hard-coded user id and password if you are on Win 2K or to turn on Kerberos authentication if you are on win server 2003 http://www.microsoft.com/windowsserv...s/default.mspx
-- [note: if this post answers your question, you can mark it as an answer using the web-based newsreader functions] ----- HTH, Phillip Williams http://www.societopia.net http://www.webswapp.com
"Mark" wrote:
Im using ASP 2.0
As a simple demonstration i would like to do the following:
if username has permission then response.write(secure stuff) else response.write("") end if
Determining whether that user has permission is the part i want to be able to do. For instance get a list of the users in the ContactAdmin Active Directory group, and compare the currently logged in user to see if he is in the list. If he is then he has permission in the above code.
I hope that makes a little more sense! :)
-- Mark
"Phillip Williams" wrote:
> It depends on how you implement your menu. Are you planning to use the > ASP.NET 2.0 navigation objects or regular ASP.NET 1.x techniques? > > For ASP.NET 2.0 you may read this article from the QuickStart Tutorials: > http://66.129.71.130/QuickStartv20/a....aspx#security > The Personal Web Site Starter Kit is a good demonstration. You can create > one by selecting File->new->Website->Personal Web Site Starter Kit. > > In one implementation using ASP.NET 1.x I had the menu entries saved in a > database (where each record stores the roles to which this menu item is > available). There are 2 aspects to handle: 1) the display of the menu item, > 2) the access authority to the folder or file where the menu item is linked. > > -- > [note: if this post answers your question, you can mark it as an answer > using the web-based newsreader functions] > ----- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "Mark" wrote: > > > How would i go about using windows authentication to determine whether > > someone was in a active directory group, and if they were the page would > > display something different. > > > > For instance, when someone goes to my default.asp page, only people within > > the "ContactAdmins" group would see the admin links, and other people would > > not! > > > > Please help me! :) > > > > -- > > Mark This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Google Mike |
last post by:
You know, while working on my moonlight corporation's LAMP project at
home this weekend, I couldn't help but wonder if people writing similar
projects are solving similar problems with having to...
|
by: Bob Everland |
last post by:
I have an application that is ISAPI and the only way to
secure it is through NT permissions. I need to have a way
to login to windows authentication so that when I get to
the ISAPI application no...
|
by: Betty Harvey |
last post by:
I can't believe it is another year!!! This January officially starts
our 10th year in existance! I currently have the agenda's starting
in April 1997. I think it would be interesting to look at...
|
by: feng |
last post by:
Hi,
I am trying to debug my asp.net project in VS.Net. What I
am getting is a error message that says "Error when trying
to run project: Unable to start debugger on the web
server. you do not...
|
by: howard dierking |
last post by:
Hi,
I am using local windows groups as roles in an asp.net application. In my
web.config file, I have the following:
<authentication mode="Windows" />
<authorization>
<allow...
|
by: blogan |
last post by:
We are adding a new DB2 server to our domain. DB2 is version
8.1.7.445, and it is installed on a Windows 2003 server. The server is
a domain controller and the domain uses Active Directory. It...
|
by: CJM |
last post by:
I need to be able to determine if the user is a member of a given AD group.
I have a method of doing this, but it is not suitable for 64bit OS's, so I
need to find an alternative route. I actually...
|
by: Max2006 |
last post by:
Hi,
I am trying to limit my wcf service endpoint to response to only given
windows user or group. How can I do that? Is there any way to configure that
in the .config file?
Thank you,
Max
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |