473,473 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to access web.config deny and allow users tag values?

Below is the code of web.config file:

<configuration>
<system.web>
<authentication mode="Forms" />
<authorization>
<allow users="Admin"/>
<deny users="Jack,Mary" />
<deny users="?">
</authorization>
</system.web>
</configuration>

I wanna access the deny and allow tag values and authenticate the
users.

Pl. let me the piece of code to work over here.

Thanks for ne kind of pointers too (I did google it myself also)

Jun 6 '06 #1
5 16404
profdotnet,
Actually this is a generic ASP.NET post and probably should have been posted
to the ASP.NET group, not the C# language group.

Hard - coded values in the web.config are just a convenience and are not
designed to be "accessed programmatically". I think what you really want to
do here is set up forms authentication with roles against a data store (such
as SQL Server).
There are a number of articles that show how to do this, including one I
wrote some time ago here:

http://www.eggheadcafe.com/articles/20020906.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Below is the code of web.config file:

<configuration>
<system.web>
<authentication mode="Forms" />
<authorization>
<allow users="Admin"/>
<deny users="Jack,Mary" />
<deny users="?">
</authorization>
</system.web>
</configuration>

I wanna access the deny and allow tag values and authenticate the
users.

Pl. let me the piece of code to work over here.

Thanks for ne kind of pointers too (I did google it myself also)

Jun 6 '06 #2
Thanks Peter

Can you tell me how does <allow users="Admin"/> <deny
users="Jack,Mary" /> tags really can be used to authenticate
application or is that these tags alone don't work.

Your code link does not deal with such kind of sepcific users in allow
and deny tags.

Infact I would like to know what is the real advantage of adding users
to deny and allow tags and what kind of code can really make use of
such info stored in deny and allow tags.

Hope you make this clear.

Peter wrote:
profdotnet,
Actually this is a generic ASP.NET post and probably should have been posted
to the ASP.NET group, not the C# language group.

Hard - coded values in the web.config are just a convenience and are not
designed to be "accessed programmatically". I think what you really want to
do here is set up forms authentication with roles against a data store (such
as SQL Server).
There are a number of articles that show how to do this, including one I
wrote some time ago here:

http://www.eggheadcafe.com/articles/20020906.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Below is the code of web.config file:

<configuration>
<system.web>
<authentication mode="Forms" />
<authorization>
<allow users="Admin"/>
<deny users="Jack,Mary" />
<deny users="?">
</authorization>
</system.web>
</configuration>

I wanna access the deny and allow tag values and authenticate the
users.

Pl. let me the piece of code to work over here.

Thanks for ne kind of pointers too (I did google it myself also)


Jun 7 '06 #3
When you perform authentication (typically with forms authentication) each
authenticated user object can be supplied with the list of roles that it
carries.

So, for example, <allow users="Admin"/> would indeed only allow users that
have the "Admin" role attached.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Thanks Peter

Can you tell me how does <allow users="Admin"/> <deny
users="Jack,Mary" /> tags really can be used to authenticate
application or is that these tags alone don't work.

Your code link does not deal with such kind of sepcific users in allow
and deny tags.

Infact I would like to know what is the real advantage of adding users
to deny and allow tags and what kind of code can really make use of
such info stored in deny and allow tags.

Hope you make this clear.

Peter wrote:
profdotnet,
Actually this is a generic ASP.NET post and probably should have been posted
to the ASP.NET group, not the C# language group.

Hard - coded values in the web.config are just a convenience and are not
designed to be "accessed programmatically". I think what you really want to
do here is set up forms authentication with roles against a data store (such
as SQL Server).
There are a number of articles that show how to do this, including one I
wrote some time ago here:

http://www.eggheadcafe.com/articles/20020906.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Below is the code of web.config file:

<configuration>
<system.web>
<authentication mode="Forms" />
<authorization>
<allow users="Admin"/>
<deny users="Jack,Mary" />
<deny users="?">
</authorization>
</system.web>
</configuration>

I wanna access the deny and allow tag values and authenticate the
users.

Pl. let me the piece of code to work over here.

Thanks for ne kind of pointers too (I did google it myself also)


Jun 7 '06 #4
Thanks Peter for explainin'.

I would like to know if users are different from roles in allow tag?

Does page identify allow and deny tag values automatically to
authenticate users?

How do I access allow and deny tag values?

Have a nice time.

Peter wrote:
When you perform authentication (typically with forms authentication) each
authenticated user object can be supplied with the list of roles that it
carries.

So, for example, <allow users="Admin"/> would indeed only allow users that
have the "Admin" role attached.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Thanks Peter

Can you tell me how does <allow users="Admin"/> <deny
users="Jack,Mary" /> tags really can be used to authenticate
application or is that these tags alone don't work.

Your code link does not deal with such kind of sepcific users in allow
and deny tags.

Infact I would like to know what is the real advantage of adding users
to deny and allow tags and what kind of code can really make use of
such info stored in deny and allow tags.

Hope you make this clear.

Peter wrote:
profdotnet,
Actually this is a generic ASP.NET post and probably should have been posted
to the ASP.NET group, not the C# language group.

Hard - coded values in the web.config are just a convenience and are not
designed to be "accessed programmatically". I think what you really want to
do here is set up forms authentication with roles against a data store (such
as SQL Server).
There are a number of articles that show how to do this, including one I
wrote some time ago here:

http://www.eggheadcafe.com/articles/20020906.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:

> Below is the code of web.config file:
>
> <configuration>
> <system.web>
> <authentication mode="Forms" />
> <authorization>
> <allow users="Admin"/>
> <deny users="Jack,Mary" />
> <deny users="?">
> </authorization>
> </system.web>
> </configuration>
>
> I wanna access the deny and allow tag values and authenticate the
> users.
>
> Pl. let me the piece of code to work over here.
>
> Thanks for ne kind of pointers too (I did google it myself also)
>
>



Jun 9 '06 #5
It sounds like a little study is in order. Take a look at this article:

http://www.eggheadcafe.com/articles/20020906.asp
Cheers,
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Thanks Peter for explainin'.

I would like to know if users are different from roles in allow tag?

Does page identify allow and deny tag values automatically to
authenticate users?

How do I access allow and deny tag values?

Have a nice time.

Peter wrote:
When you perform authentication (typically with forms authentication) each
authenticated user object can be supplied with the list of roles that it
carries.

So, for example, <allow users="Admin"/> would indeed only allow users that
have the "Admin" role attached.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"profdotnet" wrote:
Thanks Peter

Can you tell me how does <allow users="Admin"/> <deny
users="Jack,Mary" /> tags really can be used to authenticate
application or is that these tags alone don't work.

Your code link does not deal with such kind of sepcific users in allow
and deny tags.

Infact I would like to know what is the real advantage of adding users
to deny and allow tags and what kind of code can really make use of
such info stored in deny and allow tags.

Hope you make this clear.

Peter wrote:
> profdotnet,
> Actually this is a generic ASP.NET post and probably should have been posted
> to the ASP.NET group, not the C# language group.
>
> Hard - coded values in the web.config are just a convenience and are not
> designed to be "accessed programmatically". I think what you really want to
> do here is set up forms authentication with roles against a data store (such
> as SQL Server).
> There are a number of articles that show how to do this, including one I
> wrote some time ago here:
>
> http://www.eggheadcafe.com/articles/20020906.asp
>
>
>
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "profdotnet" wrote:
>
> > Below is the code of web.config file:
> >
> > <configuration>
> > <system.web>
> > <authentication mode="Forms" />
> > <authorization>
> > <allow users="Admin"/>
> > <deny users="Jack,Mary" />
> > <deny users="?">
> > </authorization>
> > </system.web>
> > </configuration>
> >
> > I wanna access the deny and allow tag values and authenticate the
> > users.
> >
> > Pl. let me the piece of code to work over here.
> >
> > Thanks for ne kind of pointers too (I did google it myself also)
> >
> >


Jun 9 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bob C. | last post by:
Question: Why would I not be able to import an Access 97 table in which some records have null values in fields that allow null values? Wouldn't the table's design be imported first, bringing...
2
by: MichaelB | last post by:
When I try logging into my web app using local host I am getting the "HTTP 403.9 - Access Forbidden: Too many users are connected Internet Information Services". The thing is I do not have 10 users...
4
by: Carlos | last post by:
Hi all, is it possible to configute an asp .net app using web config, to allow access to users within a particular domain only?. Any help is greatly appreciated. Thanks in advance, Carlos
7
by: ABC | last post by:
How can I deny all users directly access image files from images folder?
2
by: Tim::.. | last post by:
Hi can someone please tell me why this web.config file doesn't deny access to all for the folder it is in??? I have the web.config file in a folder called contents but for some reason I can...
1
by: Laurence | last post by:
Hi folks, In the middle of page 231 on the book "Administration Guide - Implementation" stated - "In addition to these package privileges, the BINDADD database privilege allows users to create...
1
by: PaulG | last post by:
Hi I'm trying to implement roles onto a .NET2 enviroment running IIS using Form Authentication. Using default aspnet login screen working back to a SQL server. The Web. config for directory is...
1
by: leela mn | last post by:
Hi Everybody!!! i have a situation where in i should allow users to access the website only once from a particular system.. so is there any way from which we can know all the windows open????
18
by: =?Utf-8?B?VG9t?= | last post by:
is it possible to add a bunch of users to group and only allow group to access the web page or do I need to add each user to the web.config file? Or is there another way to do this? I just took...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.