Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 6th, 2006, 07:35 PM
profdotnet
Guest
 
Posts: n/a
Default 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)


  #2  
Old June 6th, 2006, 08:25 PM
Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
Default RE: How to access web.config deny and allow users tag values?

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:
[color=blue]
> 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)
>
>[/color]
  #3  
Old June 7th, 2006, 12:55 PM
profdotnet
Guest
 
Posts: n/a
Default Re: How to access web.config deny and allow users tag values?

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:[color=blue]
> 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:
>[color=green]
> > 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)
> >
> >[/color][/color]

  #4  
Old June 7th, 2006, 04:15 PM
Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
Default Re: How to access web.config deny and allow users tag values?

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:
[color=blue]
> 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:[color=green]
> > 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:
> >[color=darkred]
> > > 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)
> > >
> > >[/color][/color]
>
>[/color]
  #5  
Old June 9th, 2006, 07:15 AM
profdotnet
Guest
 
Posts: n/a
Default Re: How to access web.config deny and allow users tag values?

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:[color=blue]
> 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:
>[color=green]
> > 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:[color=darkred]
> > > 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)
> > > >
> > > >[/color]
> >
> >[/color][/color]

  #6  
Old June 9th, 2006, 01:05 PM
Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
Default Re: How to access web.config deny and allow users tag values?

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:
[color=blue]
> 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:[color=green]
> > 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:
> >[color=darkred]
> > > 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)
> > > > >
> > > > >
> > >
> > >[/color][/color]
>
>[/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.