基于目录的认证 [英] Directory based authentication

查看:67
本文介绍了基于目录的认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一组管理页面放在一个名为admin的子文件夹里面

我的应用程序文件夹。

我想限制对这些管理页面的访问。

我该怎么做?


在Linux中,我可以用密码保护目录,因此,无论何时第一次访问admin子文件夹中的页面

,都会弹出一个身份验证

窗口,询问用户名密码。如何在IIS中实现相同的




这样我就可以避免以编程方式实现登录功能。


有人可以点亮这个吗?


谢谢

SeeSharp。

解决方案

您可以进行表单身份验证或Windows身份验证,然后使用

位置标记或创建web.config(在该文件夹中)以指定特定的

权限特定文件夹使用基于角色的授权例如

使用位置标记设置特定文件夹的权限,

< location path ="< foldername>">

< system.web>

< autorization>

< allow users =" Admin">

< deny users =" *">

< / autorization>

< /system.web>

< / location> < br $> b $ b -

Saravana

微软印度社区之星,

MCAD,SE,SD,DBA。

看夏普 < SM **** @ inapp.com>在消息中写道

新闻:#U ************** @ TK2MSFTNGP11.phx.gbl ...

大家好,

我有一组管理页面放在我的应用程序文件夹中名为admin
的子文件夹中。
我想限制对这些管理页面的访问。
如何我可以这样做吗?

在Linux中,我可以用密码保护目录,这样每当第一次访问admin子文件夹中的页面时,就会有
认证窗口弹出询问用户名密码。我怎样才能在IIS中实现相同的功能?

这样我就可以避免以编程方式实现登录功能。

任何人都可以点亮这个吗?

谢谢
SeeSharp。



谢谢Saravana,


但我仍然遇到问题。它显示访问被拒绝的问题。

我有一个名为app的父目录。我将其配置为虚拟的

目录。

我使用控制面板中的IIS配置工具,右键单击应用程序 - >所有

任务 - >权限向导 - >选择新的安全设置 - >公共

网站。

现在我可以访问app文件夹中的页面 http://localhost/app/index1.aspx

在app文件夹的web.config中,我有以下数据:

********************************************* *** ********

<?xml version =" 1.0"编码= QUOT; UTF-8英寸?>

< configuration>

< system.web>


< compilation defaultLanguage =" c#"调试= QUOT;真" />

< customErrors mode =" RemoteOnly" />

< authentication mode =" Windows" />

< trace enabled =" false" requestLimit = QUOT; 10" pageOutput =" false"

traceMode =" SortByTime"设置LocalOnly ="真" />

< sessionState mode =" InProc" stateConnectionString =" tcpip = 127.0.0.1:42424"

sqlConnectionString =" data source = 127.0.0.1; user id = sa; password ="

cookieless = "假QUOT;超时= QUOT; 20" />

< globalization requestEncoding =" utf-8"的ResponseEncoding = QUOT; UTF-8英寸/>

< /system.web>

< location path =" admin">

< system.web> ;

< authorization>

< allow users =" abcd" />

< deny users =" *" />

< / authorization>

< /system.web>

< / location>

< / configuration>

****************************

我的app文件夹中有一个子文件夹管理员。

实际上我把它作为另一个应用程序并将应用程序的

文件夹复制为一个名为的子文件夹管理员在我的应用程序文件夹中。

因此,admin文件夹也有一个web.config。

但是我删除它以便没有歧义。

我没有把admin子文件夹作为虚拟目录。


现在有了上面的安全设置,我应该把这些文件放在

admin中文件夹为 http://localhost/app/admin/index1.aspx

它应该要求验证,当我输入用户名密码

用户abcd时,它应该让我进去。

但这不会发生。

我得到了n错误。

我尝试将admin子文件夹作为虚拟目录。

我甚至试图保留其web.config并将其置于其中:

< authorization>

< allow users =" abcd" />

< deny users =" *" />

< / authorization>

在这种情况下它可以工作,但它允许所有用户进入。

不单独使用abcd。


你可以点亮这个吗?

非常感谢

SeeSharp。


Saravana < SA ****** @ sct.co.in>在消息中写道

新闻:Oc ************** @ TK2MSFTNGP11.phx.gbl ...

你可以去表格身份验证或Windows身份验证,然后使用
位置标记或创建web.config(在该文件夹中),以使用基于角色的授权为特定文件夹指定特定的权限。例如,使用位置标记设置对特定文件夹的权限,
< location path ="< foldername>">
< system.web>
< ; autorization>
< allow users =" Admin">
< deny users =" *">
< / autorization>
< / system.web>
< / location>

-
Saravana
微软印度社区之星,
MCAD,SE,SD,DBA。

看夏普 < SM **** @ inapp.com>在消息中写道
新闻:#U ************** @ TK2MSFTNGP11.phx.gbl ...

大家好,
<我有一组管理页面放在一个名为admin

的子文件夹中

我的应用程序文件夹。
我想限制访问这些管理页面。
我该怎么做?

在Linux中,我可以用密码保护目录,这样每当第一次访问admin子文件夹中的页面时,弹出一个


认证

窗口,询问用户名密码。如何在IIS中实现相同的


这样我就可以避免以编程方式实现登录功能。

任何人都可以点亮这个吗?

谢谢
SeeSharp。




已设置集成身份验证或IIS中的基本身份验证。所以首先

在IIS中设置其身份验证模式,然后在web.config中启用模拟。

然后尝试,它应该可以工作。


-

Saravana

微软印度社区之星,

MCAD,SE,SD,DBA。

看到夏普 < SM **** @ inapp.com>在消息中写道

新闻:e9 ************** @ tk2msftngp13.phx.gbl ...

谢谢Saravana,

但我仍然遇到问题。它显示了访问被拒绝的问题。
我有一个名为app的父目录。我将其配置为虚拟目录。
我使用控制面板中的IIS配置工具,右键单击应用程序 - >
所有任务 - >权限向导 - >选择新的安全设置 - >公共
网站。
现在我可以访问app文件夹中的页面
http://localhost/app/index1.aspx 在app文件夹的web.config中,我有以下数据:
************* ************************************* ********
< ;?xml version =" 1.0"编码= QUOT; UTF-8英寸?>
< configuration>
< system.web>

< compilation defaultLanguage =" c#"调试= QUOT;真" />
< customErrors mode =" RemoteOnly" />
< authentication mode =" Windows" />
< trace enabled =" false" requestLimit = QUOT; 10" pageOutput =" false"
traceMode =" SortByTime"设置LocalOnly ="真" />
< sessionState mode =" InProc"
stateConnectionString =" tcpip = 127.0.0.1:42424" sqlConnectionString =" data source = 127.0.0.1; user id = sa; password ="
cookieless =" false"超时= QUOT; 20" />
< globalization requestEncoding =" utf-8"的ResponseEncoding = QUOT; UTF-8英寸/>
< /system.web>
< location path =" admin">
< system.web>
< authorization>
< allow users =" abcd" />
< deny users =" *" />
< / authorization>
< /system.web>
< / location>
< / configuration>
***** ***********************

我的app文件夹中有一个子文件夹管理员。
其实我是这样做的另一个应用程序并将应用程序的
文件夹复制为我的app文件夹中名为admin的子文件夹。
因此,admin文件夹也有一个web.config。
但是我删除它以便那里没有歧义。
我没有将admin子文件夹作为虚拟目录。

现在有了上述安全设置,我应该把
admin文件夹中的文件作为 http://localhost/app/admin/index1.aspx
它应该要求验证,当我输入用户abcd的用户名密码时,它应该让我进去。
但这不会发生。
我收到错误。
我尝试将admin子文件夹作为虚拟direc保守党。
我甚至试图保留其web.config并将其置于其中:
< authorization>
< allow users =" abcd" />
< deny users =" *" />
< / authorization>
在这种情况下它可以工作,但它允许所有用户进入。
不单独使用abcd。

请你点亮对此?
非常感谢
SeeSharp。

Saravana < SA ****** @ sct.co.in>在消息中写道
新闻:Oc ************** @ TK2MSFTNGP11.phx.gbl ...

您可以进行表单身份验证或Windows身份验证,然后使用
位置标记或创建web.config(在该文件夹中)使用基于角色的授权指定
特定

特定文件夹的权限。对于使用位置标记设置特定文件夹权限的
示例,
< location path ="< foldername>">
< system.web>
< ; autorization>
< allow users =" Admin">
< deny users =" *">
< / autorization>
< / system.web>
< / location>

-
Saravana
微软印度社区之星,
MCAD,SE,SD,DBA。

看夏普 < SM **** @ inapp.com>在消息中写道
新闻:#U ************** @ TK2MSFTNGP11.phx.gbl ...

大家好,
<我有一组管理页面放在一个名为admin

的子文件夹中

我的应用程序文件夹。
我想限制访问这些管理页面。
我该怎么做?

在Linux中,我可以用密码保护目录,这样只要第一次访问admin子文件夹中的
页面,弹出一个


认证

窗口,询问用户名密码。如何在IIS中实现


?这样我就可以避免以编程方式实现登录
功能。
可以有人请点亮这个吗?

谢谢
SeeSharp。





Hello all,

I have a set of admin pages which are put in a subfolder called admin inside
my application folder.
I want to limit access to these admin pages.
How can I do this?

In Linux, I can password protect the directory, so that whenever a page
within the admin subfolder is accessed for the first time, an authentication
window pops up asking for username-password. How can I implement the same
in IIS ?

This way I can avoid having to programmatically implement login feature.

Can anyone please throw light on this ?

Thanks
SeeSharp.

解决方案

You can go for form authentication or windows authentication, then use
location tag or create web.config (in that folder) to specify particular
permission for specific folder using role based authorization. For example
to set permission to particular folder using location tag,
<location path="<foldername>">
<system.web>
<autorization>
<allow users="Admin">
<deny users="*">
</autorization>
</system.web>
</location>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"See Sharp" <sm****@inapp.com> wrote in message
news:#U**************@TK2MSFTNGP11.phx.gbl...

Hello all,

I have a set of admin pages which are put in a subfolder called admin inside my application folder.
I want to limit access to these admin pages.
How can I do this?

In Linux, I can password protect the directory, so that whenever a page
within the admin subfolder is accessed for the first time, an authentication window pops up asking for username-password. How can I implement the same
in IIS ?

This way I can avoid having to programmatically implement login feature.

Can anyone please throw light on this ?

Thanks
SeeSharp.



Thanks Saravana,

But I still get problems. Its shows an access denied problem.
I have a parent directory called app. I configured it as a virtual
directory.
I use the IIS configuration tool from control panel, right click app -> all
tasks -> permission wizard -> select new security settings -> public
website.
Now I can access the pages in app folder as http://localhost/app/index1.aspx
In the web.config of the app folder I have the following data:
************************************************** ********
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Windows" />
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<location path="admin">
<system.web>
<authorization>
<allow users="abcd" />
<deny users="*" />
</authorization>
</system.web>
</location>
</configuration>
****************************

I have a subfolder admin in my app folder.
Actually I made it as another application and copied the application''s
folder as a subfolder called admin in my app folder.
The admin folder therefore has a web.config too.
But I deleted it so that there is no ambiguity.
I have not made the admin subfolder as a virtual directory.

Now with the above security settings, I should get the the files in the
admin folder as http://localhost/app/admin/index1.aspx
It should ask for authentication and when I enter the username password of
user abcd, it should let me in.
But This does not happen.
I get an error.
I tried making the admin subfolder as a virtual directory.
I even tried to retain its web.config and place this within it:
<authorization>
<allow users="abcd" />
<deny users="*" />
</authorization>
In that case it works, but it allows all users in.
Not abcd alone.

Can you please throw light on this ?
Thanks a lot
SeeSharp.

"Saravana" <sa******@sct.co.in> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...

You can go for form authentication or windows authentication, then use
location tag or create web.config (in that folder) to specify particular
permission for specific folder using role based authorization. For example
to set permission to particular folder using location tag,
<location path="<foldername>">
<system.web>
<autorization>
<allow users="Admin">
<deny users="*">
</autorization>
</system.web>
</location>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"See Sharp" <sm****@inapp.com> wrote in message
news:#U**************@TK2MSFTNGP11.phx.gbl...

Hello all,

I have a set of admin pages which are put in a subfolder called admin


inside

my application folder.
I want to limit access to these admin pages.
How can I do this?

In Linux, I can password protect the directory, so that whenever a page
within the admin subfolder is accessed for the first time, an


authentication

window pops up asking for username-password. How can I implement the same in IIS ?

This way I can avoid having to programmatically implement login feature.

Can anyone please throw light on this ?

Thanks
SeeSharp.




Have set integrated authentication or basic authentication in IIS. So first
set its authentication mode in IIS,then enable impersonation in web.config.
Then try, it should work.

--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"See Sharp" <sm****@inapp.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...

Thanks Saravana,

But I still get problems. Its shows an access denied problem.
I have a parent directory called app. I configured it as a virtual
directory.
I use the IIS configuration tool from control panel, right click app -> all tasks -> permission wizard -> select new security settings -> public
website.
Now I can access the pages in app folder as http://localhost/app/index1.aspx In the web.config of the app folder I have the following data:
************************************************** ********
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Windows" />
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<location path="admin">
<system.web>
<authorization>
<allow users="abcd" />
<deny users="*" />
</authorization>
</system.web>
</location>
</configuration>
****************************

I have a subfolder admin in my app folder.
Actually I made it as another application and copied the application''s
folder as a subfolder called admin in my app folder.
The admin folder therefore has a web.config too.
But I deleted it so that there is no ambiguity.
I have not made the admin subfolder as a virtual directory.

Now with the above security settings, I should get the the files in the
admin folder as http://localhost/app/admin/index1.aspx
It should ask for authentication and when I enter the username password of
user abcd, it should let me in.
But This does not happen.
I get an error.
I tried making the admin subfolder as a virtual directory.
I even tried to retain its web.config and place this within it:
<authorization>
<allow users="abcd" />
<deny users="*" />
</authorization>
In that case it works, but it allows all users in.
Not abcd alone.

Can you please throw light on this ?
Thanks a lot
SeeSharp.

"Saravana" <sa******@sct.co.in> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...

You can go for form authentication or windows authentication, then use
location tag or create web.config (in that folder) to specify particular

permission for specific folder using role based authorization. For example to set permission to particular folder using location tag,
<location path="<foldername>">
<system.web>
<autorization>
<allow users="Admin">
<deny users="*">
</autorization>
</system.web>
</location>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"See Sharp" <sm****@inapp.com> wrote in message
news:#U**************@TK2MSFTNGP11.phx.gbl...

Hello all,

I have a set of admin pages which are put in a subfolder called admin


inside

my application folder.
I want to limit access to these admin pages.
How can I do this?

In Linux, I can password protect the directory, so that whenever a page within the admin subfolder is accessed for the first time, an


authentication

window pops up asking for username-password. How can I implement the


same in IIS ?

This way I can avoid having to programmatically implement login feature.
Can anyone please throw light on this ?

Thanks
SeeSharp.





这篇关于基于目录的认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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