Microsoft MVP성태의 닷넷 이야기
Question - HTTP 401.3 on DELETE, PUT verbs [링크 복사], [링크+제목 복사]
조회: 14341
글쓴 사람
Daniel Seo (jungsoo.seo at sap.com)
홈페이지
첨부 파일
[Sample.zip]    

Hi,

I am writing this thread to ask your help.

I am encountering a problem while we are using  PUT / DELETE verbs for RESTful webservice.

 

As you see the below table,

In case I call a web service with administrator right, all verbs are operated successfully.

In case I call a web service with non-admin right, the method which is using PUT / DELETE verbs returns  401.3 error while GET/POST verbs are operated successfully.

 

I found some related articles and tested them, but I did not get reasonable results yet.

http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/3a67a302-6f7d-4453-8ce9-3d540ee8a9fa

 

As temporary workaround to enable the service, I granted access right of a user(mydomain\user) to .svc file manually.

(However, I don’t think it could be a solution because of security violation. )

 

I would very appreciate it if you would give me any opinions.

For your convenience, I am attaching a simple .NET project.

I hope I am missing a simple point. J

Thank you.

 

 

Verb

Admin user

Non-admin user

GET

O

O

POST

O

O

PUT

O

X

DELETE

O

X

 

·         System: Windows 2003 + IIS6 + .NET3.5 SP1

·         Setting in Web.Config
<authentication mode="Windows"/>
<
identity impersonate="true"></identity>

 

 

:::: Event Message (1)::::

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources.

Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to 'C:\BPC\service1.svc'.

 

:::: Event Message (2)::::

Event Type:             Information

Event Source:          ASP.NET 2.0.50727.0

Event Category:       Web Event

Event ID: 1314

Date:                        2/17/2010

Time:                       11:14:27 AM

User:                       N/A

Computer:               ICND50076690A

Description:

Event code: 4008

Event message: File authorization failed for the request.

Event time: 2/17/2010 11:14:27 AM

Event time (UTC): 2/17/2010 2:14:27 AM

Event ID: 7ccb60ad5fd341aaba44f16bdd7f3bfd

Event sequence: 3

Event occurrence: 1

Event detail code: 0

 

Application information:

    Application domain: /LM/W3SVC/1/Root/Bpc-1-129108464673098914

    Trust level: Full

    Application Virtual Path: /Bpc

    Application Path: C:\BPC\

    Machine name: ICND50076690A

 

Process information:

    Process ID: 11392

    Process name: w3wp.exe

    Account name: NT AUTHORITY\NETWORK SERVICE

 

Request information:

    Request URL: http://10.60.50.200/bpc/service1.svc/PUT

    Request path: /bpc/service1.svc/PUT

    User host address: 10.60.50.200

    User: ICND50076690A\User

    Is authenticated: True

    Authentication Type: NTLM

    Thread account name: NT AUTHORITY\NETWORK SERVICE

 

Custom event details:

 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 








[최초 등록일: ]
[최종 수정일: 2/18/2010]


비밀번호

댓글 작성자
 



2010-02-18 02시29분
[꼭지] 안녕하세요. 이전에 인증관련으로 질문드렸던, 꼭지(서정수) 입니다.
영어로 써놓은 글이 있어 개인 편의상 그대로 옮겨왔습니다. 혹.... 영어로 고민 하시지 않으시길..^^
[guest]
2010-02-24 09시45분
이미 해결하셨는지 모르겠는데. 퇴근 후 테스트 해보고 ^^ 말씀드리겠습니다.
kevin25
2010-02-24 11시28분
일단, 미리 답변드리면.
impersonate 모드로 일반 User계정으로 삭제가 안된다는 것은, 보안상 적절한 조치라고 보입니다.
아마도 적절한 ACL 설정으로 가능하지 않을까 싶은데... 암튼 자세한 것은 집에서. ^^;

kevin25
2010-02-25 12시07분
[kevin25] 위의 글에서, 보안상 피하고 싶다고는 했지만 테스트 해본 바로는 어쩔 수 없이 svc 파일에 ACL 권한을 주는 수 밖에는 별다른 방법을 찾지 못했습니다.

대신에, HttpContext.Current를 안 써도 되는 경우라면 "AspNetCompatibilityRequirements" 설정을 제거할 수가 있는데, 그런 상태에서는 svc 보안을 주지 않아도 정상적으로 admin/non-admin 계정으로 호출이 되었습니다.

kevin25
2010-03-29 03시10분
[꼭지] 이런 내용이 MSDN에 있네요.
"When this property("aspNetCompatibilityEnabled") is set to true, requests to Windows Communication Foundation (WCF) services flow through the ASP.NET HTTP pipeline and communication over non-HTTP protocols is prohibited.

http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.servicehostingenvironmentsection.aspnetcompatibilityenabled.aspx


[guest]
2010-05-03 05시49분
[꼭지(서정수)] 정확한 정보가 될 것 같네요.

FileAuthorizationModule Class
http://msdn.microsoft.com/en-us/library/system.web.security.fileauthorizationmodule(v=VS.80).aspx

Remarks
This module provides authorization services against file-system access-control lists (ACLs). When the mode attribute of the authentication Element (ASP.NET Settings Schema) configuration element is set to Windows so that the WindowsAuthenticationModule is being used for the application, the FileAuthorizationModule module ensures that the requesting user is allowed read or write access to the resource, depending on the request verb, before executing the request. For more information, see the CheckFileAccessForUser method.



FileAuthorizationModule.CheckFileAccessForUser Method
http://msdn.microsoft.com/en-us/library/system.web.security.fileauthorizationmodule.checkfileaccessforuser(v=VS.80).aspx

Remarks
The CheckFileAccessForUser method checks to see whether the current user, represented by a Windows access token, is granted access to the requested file in the file-system access-control lists (ACLs). The virtual path is mapped to the physical file-system path before the check is made.
If the HTTP verb used to make the request is GET, POST, or HEAD, the CheckFileAccessForUser method checks for read access to the file. If any other verb is used, the CheckFileAccessForUser method checks for read/write permission to the file.
Security Note If the FileAuthorizationModule module is not defined in the httpModules configuration section for the application, the FileAuthorizationModule module always returns true.

[guest]

... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
1335황지혜10/24/201414090psexec 관련 질문드립니다. [1]
1334dell10/24/201410452여기가 있는줄 모르고 방명록에 남겼네요 ㅠㅠ 방명록 한번만 봐주시면 안될지요? [1]
1333왕초보10/24/201411035Bitmap 질문 [5]
1332김동진10/16/201417131clickonce 와 smartscreen filter 기능에 대해서 [2]
1331궁굼합니다10/8/201411072loopback adapter 자동 설치가 가능 한가요? [2]
1330이현중10/8/201413515파일 다운로드 방법 문의 [2]파일 다운로드1
1329popo10/2/201411184싱글톤과 싱글톤 소멸자에 대해 궁금점이 있습니다. [1]
1328달쏭9/25/201411929WCF Service측에서 parameter 값이 null이 오는 이유를 알고 싶어요. [2]
1326궁굼합니다9/19/201411392VB의 Shell 기능과 완벽히 똑같은 기능의 함수 [4]
1325지현태9/18/201411090WPF 의존속성과 바인딩에 대한 질문입니다.. [1]파일 다운로드1
1324popo9/17/201410301wcf 질문 드립니다. [1]
1323Anon...9/17/201412486인스턴스와 객체의 차이 [1]
1322김영대9/16/201412218죄송하지만 .NET 관련 질문게시판이지만 혹시 ASP.NET MVC에 대해서 질문 드려도 됩니까 (__);; [2]
1321부탁드립...9/15/201413798윈도우 어플리케이션 개발 방법(?) 에대해(직접적인 코드라기보단 프로젝트 방향??) [14]
1320소켓서버...9/13/201413903서로다른 포트번호로 로컬 Socket 서버를 개설시 Close 문제 입니다. [2]
1319ㅇㅇ9/12/201414853134쪽 예제 오타 [3]
1318블루투쓰9/12/201410754page 184 질문드립니다. [1]
1316서동원8/21/201416917ActiveX 개체가 이 속성 또는 메서드를 지원하지 않습니다. [1]
1313양해진8/20/201410116메시지창에 대해서요 [1]
1312김영대8/18/201411731안녕하십니까 정성태님 죄송하지만 C#.NET의 FileInfo 클래스의 CopyTo 메서드 질문드립니다. [3]
1311김솔8/18/201412589nsis파일 수정중에요! [2]
1310조정용8/17/201413477WCF 프로그램에서 Task를 이용한 백그라운드 작업 시 클라이언트에 대한 병목현상. [4]파일 다운로드1
1309서동원8/12/201411644안녕하세요. embeded dll과 관련하여 질문드립니다. [4]
1308김솔8/11/201416221리스트뷰에서 중복파일체크를 하고싶습니다. [3]
1306이상현8/7/20149951Entity 프레임웍에서 테이블만 추가로 등록하는 방법
1307이상현8/7/201410265    답변글 [답변]: 자답이네요. [1]
... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...