Microsoft MVP성태의 닷넷 이야기
Question - HTTP 401.3 on DELETE, PUT verbs [링크 복사], [링크+제목 복사],
조회: 21412
글쓴 사람
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.

 








[최초 등록일: ]
[최종 수정일: 6/30/2025]


비밀번호

댓글 작성자
 



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.

https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.configuration.servicehostingenvironmentsection.aspnetcompatibilityenabled
[guest]
2010-05-03 05시49분
[꼭지(서정수)] 정확한 정보가 될 것 같네요.

FileAuthorizationModule Class
https://learn.microsoft.com/en-us/dotnet/api/system.web.security.fileauthorizationmodule

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
https://learn.microsoft.com/en-us/dotnet/api/system.web.security.fileauthorizationmodule.checkfileaccessforuser

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]

... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...
NoWriterDateCnt.TitleFile(s)
4782김형민12/6/201617836[ C# 6.0 ] 126p 오타인가요? [6]
4781질문자11/29/201617934ms워드 저장 오류 [1]
4780최진11/28/201622530안녕 하세요 빌드 관련해서 질문드립니다 꾸벅 [4]
4779손니11/28/201618863안녕하세요 질문하다 드려도 될까요 [3]
4778김상호11/25/201617961재귀호출->비재귀호출 [2]파일 다운로드1
4777권오영11/12/201620903아래 질문 상세 소스전체입니다.. [3]
4776권오영11/11/201618740제가 이클립스를 공부중인데..이상한것을 찾았습니다.. [2]
4775이성환11/11/201622504안녕하세요. SnapsToDevicePixels 질문입니다. [5]파일 다운로드1
4774popo11/10/201619055.net SSL통신 관련 질문 드립니다. [1]
4773김상호11/4/201620859재귀함수 반복문 변환 [1]파일 다운로드1
4772자연인10/27/201622172hwpctrl을 사용하는 사이트에서 나와 브라우저를 종료하면 오류메세지가 나옵니다. [1]파일 다운로드1
4771문종훈10/18/201622032.net 소스 질문이 있습니다 [2]
4770누구게~...10/15/201619305세도나 [1]
4769spow...10/13/201617685올리시는 게시물에 '좋아요'를 선택할 수 있도록 해주세요 [3]
4768브라운10/11/201619446질문 하나만 드려도 될까요 [4]
4767암호군10/4/201624912c# aes 128 암복호화 관련 문의드립니다. [3]
4766김신철9/29/201619498Visual Studio 2015에서 .net 3.5로 c# 6.0 사용시 문제점에 대해서 궁금합니다. [1]
4765spow...9/23/201618517참조를 통해 속성의 값을 변경하고 싶을 때 우아한 코딩 방법이 있을까요? [2]
4764지현명9/22/201620415Visual Studio 2008 c#에서 추가된 솔류션의 디버깅이 안걸립니다. [2]파일 다운로드1
4763송기태9/20/201618646안녕하세요! 질문이 있어 문의드립니다! [1]파일 다운로드1
4762김신철9/20/201619842Visual Studio 2015 마이그레이션 후 빌드 및 에러 문제.. 도와주세요~ [2]
4761JH9/19/201620285WPF로 Viewbox 사용 시 폰트 크기 일정화 여부 [1]
4760초보9/18/201621568유닉스서버(HP)에서 C# 서버 프로그램 실행 가능 한지요? [1]
4759dev009/16/201623032Queue out of memory [3]
4758임기성9/12/201621569MS오피스 워드 64비트에서 32비트 COM개체 사용방법 문의 [2]
4757조영준9/7/201619371DLL 후킹과 관련해서 질문이 있습니다. [2]
... 31  32  33  34  35  36  37  38  39  40  41  42  43  [44]  45  ...