RE: Programmatic Forms Authentication
- From: Dominick Baier [DevelopMentor] <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Feb 2006 15:23:42 +0000 (UTC)
Hi,
you can use Context.User.IsInRole() to check for the role of the user. If that fails you can call FormsAuthentication.RedirectToLoginPage
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
""Yuan Ren[MSFT]"" wrote:
For the current issue, my understanding is that you want toI think you misunderstood my question. I'm not asking how do I apply
management the authentication of the site. If I have misunderstood
anything, please feel free to let me know.
forms authentication to a certain directory or file from the
web.config, I'm asking how do I appliy authentication and
authorization to a URL programmatically. For instance let's say I
have the following 2 URLs that I want to apply roles to:
http://myweb.com/doc.aspx?id=1
I want the following roll:
ServiceA
http://myweb.com/doc.aspx?id=2
I want the following roll:
ServiceB
I want the fact that these two URL's have these rolls to be managed in
a database and then when a request comes in for these URL's I want to
let forms authentication know what authorization and roles to apply to
that URL.
As far as I know, the "location" element in the web.config file canI appreciate your input here but it has no relevance to my question.
be used for the directory or sub directories. I suggest you put the
pages which allow the authorized client to access into the same
directory. And then, you just need mark the path of the directory in
the web.config file. The following link is detail explanation about
the "location" element. I hope this will be helpful.
If you have any issues or concerns, please let me know. It's my
pleasure to be of assistance.
I know how to control authentication and authorization from the
web.config.
Thanks,
Tyler
.
- Prev by Date: container name
- Next by Date: Re: Custom RoleProvider + <allow roles> not working
- Previous by thread: RE: Programmatic Forms Authentication
- Next by thread: container name
- Index(es):
Relevant Pages
|
|