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

... 31  32  33  34  35  36  37  38  39  40  41  42  43  44  [45]  ...
NoWriterDateCnt.TitleFile(s)
4722지나가던...5/15/201614369Part 3 pdf파일 그림 재수정 문의 [1]
4723지나가던...5/16/201611601    답변글 [답변]: Part 3 pdf파일 그림 재수정 문의 [1]
4721김종희4/30/2016117573D 시뮬레이션 개발 [1]
4720DC4/29/201611155C# 6.0 델리게이트 인스턴스화 관련 질문~ [2]
4719이민구4/29/201612079[시작하세요! C# 프로그래밍] 4.5.1.6 열거형 마지막 예제 질문입니다. [4]파일 다운로드1
4718ds4/27/201610390오라클 DB 칼럼에 있는 특정 데이터를 가져올수가 있나여? [1]
4717최령진4/26/20169479모바일 웹 앱 관련문의 드립니다 [1]
4715과객4/7/201611484TFS 와 Stylecop Integration 시 체크인 정책 적용 방법이 궁금합니다. [1]
4714임형복4/7/201611418DLL 을 프로세스처럼 사용하기 [3]파일 다운로드1
4713김태훈4/5/201611622하위 폴더 권한 상속 문제 [1]
4712차가워4/5/201613331멀티코어 스레드 문의 [1]
4711이대희4/1/201610812Xamarin 라이센스 변경 (Visual Sutuio 무료 사용) [2]
4709가가멜3/25/201635222국내 WPF 책은 왜 2010 년 이후로 전멸인지요? [1]
4704최훈3/15/201615121C# 6.0 예제 7.1 관련 질문입니다. [2]
4702popo3/14/201614618C# WeakReference이 CPU 플랫폼 설정 마다 결과가 틀리게 나옵니다. [9]
4701쌉쓰릅3/13/201612332uwp에서 그림판의 지우개 기능을 구현하려고하는데요 참고할 만한 정보가 있을가요? [2]
4700정우진3/12/201610722안녕하세요. 10049소켓에러의 해결법을 알고싶습니다. - 수정본 [1]파일 다운로드1
4699정우진3/11/201613506안녕하세요. 10049소켓에러의 해결법을 알고싶습니다. [1]
4698지나가는3/10/201612106안녕하세요. 주기적으로 일어나는 .net 관련 질문이 있습니다 [1]
4697정우진3/9/20169731안녕하세요. AWS EC2를 이용한 서버 개발에 대해 질문드립니다. [1]
4696삽질맨3/9/201614310Winform Cold Start 로딩 속도 개선 방법이 없을까요? [1]
4695popo3/9/201612069wpf의 ICommand 질문 입니다. [5]파일 다운로드1
4694아무개2/28/201611674책 잘보고있습니다~ [1]
4693초보2/25/20169881카카오톡 오류 질문 [1]
3701강준2/19/2016193752개의 DataTable Join 결과 전체 컬럼을 DataTable 로 리턴하기 [5]
3700박성훈2/18/201610962시작하세요! C# 6.0 프로그래밍 105쪽 예제 질문 [1]
... 31  32  33  34  35  36  37  38  39  40  41  42  43  44  [45]  ...