框架1.1多重身份验证? [英] Framework 1.1 Multiple Authentication?

查看:70
本文介绍了框架1.1多重身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个带有表单身份验证和单个登录页面的网站。我/ b
有4个子目录,每个子目录应该由不同的

用户名/密码组合保护。出于测试目的,

用户名/密码被硬编码到代码隐藏的C#代码中。


如何编写我的web.config来实现这一点?


谢谢。


I have a web site with forms authentication and a single logon page. I
have 4 subdirectories, each that should be protected by a different
username/password combination. For testing purposes, the
username/password are hardcoded into the code-behind C# code.

How can I write my web.config to make this happen?

Thanks.

推荐答案

色诺芬试着查看这篇文章: -
http://aspalliance.com/articleViewer.aspx ?aId = 501& pId = 1

它应该指导你。

Patrick


" xenophon" < XE ****** @ online.nospam>在消息中写道

news:4p ******************************** @ 4ax.com ...
Xenophon try looking through this article at:-
http://aspalliance.com/articleViewer.aspx?aId=501&pId=1
It should guide you.
Patrick

"xenophon" <xe******@online.nospam> wrote in message
news:4p********************************@4ax.com...

我有一个带有表单身份验证和单个登录页面的网站。我有4个子目录,每个子目录应该由不同的用户名/密码组合保护。出于测试目的,
用户名/密码被硬编码到代码隐藏的C#代码中。

如何编写我的web.config来实现这一目标?
谢谢。



:我有一个带有表单身份验证和单个登录页面的网站。我

:有4个子目录,每个子目录应该受到不同的

:用户名/密码组合的保护。出于测试目的,

:用户名/密码被硬编码到代码隐藏的C#代码中。



:我怎么能写我的web.config来实现这个目标吗?


使用< location>元素在< system.web>之上

例如:

< location path =" firstDir">

< system.web>

< authorization>

< allow ... />

< deny ... />

< / authorization>

< /system.web>

< / location>

- -

干杯,

Gaurav Vaish

-----------
: I have a web site with forms authentication and a single logon page. I
: have 4 subdirectories, each that should be protected by a different
: username/password combination. For testing purposes, the
: username/password are hardcoded into the code-behind C# code.
:
: How can I write my web.config to make this happen?

Use <location> element on top of <system.web>
For example:
<location path="firstDir">
<system.web>
<authorization>
<allow ... />
<deny ... />
</authorization>
</system.web>
</location>
--
Cheers,
Gaurav Vaish
-----------


感谢Gaurav和Patrick提供的信息。


您好xenophon,


为多个提供单独的授权方案asp.net中的子目录

Web应用程序,通常我们有以下两个选项:

1.在每个子目录中放置一个单独的web.config,需要formsauthentication

保护。并覆盖< authorization>该web.config中的部分。

因此,该子目录中的所有页面都受到< authorization>

设置的保护。

2.使用< location> Gaurav提到的元素,这可以帮助我们在主web.config中为子目录配置

,以避免在每个子目录中放置

多个子web.config sub dir。


#Configuration< location>设置
http://msdn.microsoft .com / library / en ... igurationlocat

ionsettings.asp?frame = true


谢谢,

Steven Cheng

微软在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)



-------- ------------

|来自:Patrick.O.Ige < pa ******** @ optusnet.com.au>

|参考文献:< 4p ******************************** @ 4ax.com>

|主题:Re:Framework 1.1多重身份验证?

|日期:2005年10月30日星期日12:27:29 +1100

|行数:19

| X-Priority:3

| X-MSMail-Priority:正常

| X-Newsreader:Microsoft Outlook Express 6.00.2800.1106

| X-MimeOLE:由Microsoft MimeOLE制作V6.00.2800.1106

|消息ID:< OG ************** @ TK2MSFTNGP10.phx.gbl>

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:d58-105-58-245.dsl.vic.optusnet.com.au 58.105.58.245

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:134781

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|色诺芬试着查看这篇文章: -

| http://aspalliance.com/articleViewer.aspx?aId= 501& pId = 1

|它应该指导你。

| Patrick

|

| "色诺芬" < XE ****** @ online.nospam>在消息中写道

|新闻:4p ******************************** @ 4ax.com ...

| >

| >我有一个带有表单身份验证和单个登录页面的网站。我

| >有4个子目录,每个子目录应该有不同的保护

| >用户名/密码组合。出于测试目的,

| >用户名/密码被硬编码到代码隐藏的C#代码中。

| >

| >如何编写我的web.config来实现这一目标?

| >

| >谢谢。

| >

|

|

|

Thanks for Gaurav and Patrick''s informative inputs.

Hi xenophon,

For providing separate authorization schema for mutiple sub dirs in asp.net
web application, generally we have the following two options:
1. Put a separate web.config in each sub dir which need formsauthentication
protection. And override the <authorization> section in that web.config.
Thus, all the pages in that sub dir is protected to that <authorization >
setting.

2. Use the <location> element as Gaurav has mentioned, this can help us put
the configuration for sub dir in the main web.config so as to avoid put
multiple sub web.config in each sub dir.

#Configuration <location> Settings
http://msdn.microsoft.com/library/en...igurationlocat
ionsettings.asp?frame=true

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Patrick.O.Ige" <pa********@optusnet.com.au>
| References: <4p********************************@4ax.com>
| Subject: Re: Framework 1.1 Multiple Authentication?
| Date: Sun, 30 Oct 2005 12:27:29 +1100
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <OG**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: d58-105-58-245.dsl.vic.optusnet.com.au 58.105.58.245
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134781
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Xenophon try looking through this article at:-
| http://aspalliance.com/articleViewer.aspx?aId=501&pId=1
| It should guide you.
| Patrick
|
| "xenophon" <xe******@online.nospam> wrote in message
| news:4p********************************@4ax.com...
| >
| > I have a web site with forms authentication and a single logon page. I
| > have 4 subdirectories, each that should be protected by a different
| > username/password combination. For testing purposes, the
| > username/password are hardcoded into the code-behind C# code.
| >
| > How can I write my web.config to make this happen?
| >
| > Thanks.
| >
|
|
|


这篇关于框架1.1多重身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆