授权问题 [英] Authorization problem

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

问题描述

以下代码不会产生预期效果,只允许管理员组的

成员访问Web方法,它会阻止所有人。

== =======

< WebMethod(),_

PrincipalPermission(SecurityAction.Demand,Role:=" Administrators")> _

公共函数HelloWorld()As String

返回Hello World

结束函数

== =======


Web服务文件夹设置为只需要Windows身份验证,

就可以了。我可以通过任何问题获得用户凭据。


有什么问题?

TIA

The following code doesn''t produse the expected effect to only allow the
members of Administrators group to access the web method, it stops everyone.
=========
<WebMethod(), _
PrincipalPermission(SecurityAction.Demand, Role:="Administrators")> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
=========

The web service folder is set to require only Windows Authentication, which
goes fine. I can get the user credentials whitout any problem.

What is wrong?
TIA

推荐答案

您是否尝试过MACHINE \Administrators或正确的域名后缀? Windows

角色在.NET中总是有一个前缀。


Joe K.


" Nikolay Petrov" <乔************** @ mail.bg>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Did you try MACHINE\Administrators or the proper domain suffix? Windows
roles always have a prefix in .NET.

Joe K.

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
以下代码没有产生预期的效果,只允许管理员组的成员访问Web方法,它停止每个人。
=========
< WebMethod(),_
PrincipalPermission(SecurityAction.Demand,Role:=" Administrators")> _
_百度百科到百科Web服务文件夹设置为仅需要Windows身份验证,
这很好。我可以通过任何问题获得用户凭据。

有什么问题?
TIA
The following code doesn''t produse the expected effect to only allow
the members of Administrators group to access the web method, it stops
everyone.
=========
<WebMethod(), _
PrincipalPermission(SecurityAction.Demand, Role:="Administrators")> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
=========

The web service folder is set to require only Windows Authentication,
which goes fine. I can get the user credentials whitout any problem.

What is wrong?
TIA



我试过这个。没有帮助。

Joe Kaplan(MVP-ADSI)" <乔************* @ removethis.accenture.com>在消息新闻中写了

:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
I have tried this. Doesn''t help.
"Joe Kaplan (MVP - ADSI)" <jo*************@removethis.accenture.com> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl...
你有没有?尝试MACHINE \Administrators或正确的域名后缀? Windows
角色在.NET中始终有一个前缀。

Joe K。
Did you try MACHINE\Administrators or the proper domain suffix? Windows
roles always have a prefix in .NET.

Joe K.



您确定客户端吗?正在通过Windows验证

身份验证?转出

Context.User.Identity.Name的值可能是一个好主意,并确保它是你认为它的用户

是。


Joe K.


" Nikolay Petrov" <乔************** @ mail.bg>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Are you certain that the client is being authenticated with Windows
authentication? It would probably be a good idea to dump out the value of
Context.User.Identity.Name and make sure it is the user that you think it
is.

Joe K.

"Nikolay Petrov" <jo**************@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我有试过这个。没有帮助。

Joe Kaplan(MVP-ADSI)" <乔************* @ removethis.accenture.com>在消息新闻中写道
:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
I have tried this. Doesn''t help.
"Joe Kaplan (MVP - ADSI)" <jo*************@removethis.accenture.com> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl...
你试过过MACHINE \管理员或适当的域名后缀? Windows
角色在.NET中始终有一个前缀。

Joe K。
Did you try MACHINE\Administrators or the proper domain suffix? Windows
roles always have a prefix in .NET.

Joe K.




这篇关于授权问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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