OAuth 및 SAML 클레임을 사용할 때 "401 권한 없음" 오류

증상

다음과 같은 경우를 생각해볼 수 있습니다.

  • 팜에서 AD FS(Active Directory Federated Services)를 인증 공급자로 사용하는 SAML(Security Assertions Markup Language) 클레임 유형을 사용하고 있습니다.
  • Role 또는 GroupSID 클레임을 사용하여 팜의 Microsoft SharePoint 2013 사이트에서 사용자에게 권한을 부여합니다.
  • 팜 버전은 버전 15.0.4805.1000(2016년 3월 누적 업데이트)보다 이전 버전입니다.

이 시나리오에서 Role 또는 GroupSID 클레임 유형을 통해 할당된 적절한 권한이 있는 사용자는 다음과 같은 경우 OAuth 인증 방법을 사용할 때 "401 권한 없음" 오류 메시지를 받습니다.

  • 워크플로 관리자(SharePoint 2013 워크플로)
  • 웹 애플리케이션 도우미(WAC - Office Web Apps)
  • 높은 신뢰 또는 낮은 신뢰 공급자 호스팅 앱
  • 팜 서비스 간 애플리케이션 게시/사용
  • 하이브리드 SharePoint 2013/SharePoint Online 시나리오
  • Exchange 및 Lync 2013/비즈니스용 Skype SharePoint 통합

해결 방법

이 문제를 resolve 팜의 모든 서버에 Microsoft SharePoint Server용 2016년 3월 누적 업데이트를 설치합니다.

수정의 일부로 새 속성 GroupClaimType이 SPTrustedIdentityTokenIssuer 개체에 추가됩니다. OAuth가 올바르게 작동하려면 이 속성을 역할 또는 GroupSID 클레임 유형을 통해 권한이 할당된 사용자에 대한 권한 부여를 위해 올바른 클레임 유형으로 설정해야 합니다.

GroupClaimType 속성을 설정하려면 다음 Windows PowerShell 명령을 실행합니다.

#Create a variable containing the SPTrustedIdentityTokenIssuer object  
$issuer = Get-SPTrustedIdentityTokenIssuer  

#Set the GroupClaimType property to the Role claim type, do not run for GroupSID claim type  
$issuer.GroupClaimType = [Microsoft.IdentityModel.Claims.ClaimTypes]::Role   

#Set the GroupClaimType property to the GroupSID claim type, do not run for Role claim type  
$issuer.GroupClaimType = [Microsoft.IdentityModel.Claims.ClaimTypes]::GroupSid  

#Update the SPTrustedIdenityTokenIssuer object to apply the change   
$issuer.Update()   

추가 정보

실패한 워크플로의 오류 메시지 예제:

RequestorId: <Requestor ID>. Details: System.ApplicationException: HTTP 401 {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}} } {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPRequestGuid":["<SP Request GUID>"],"request-id":["<Request ID>"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4805"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Fri, 19 Aug 2016 20:35:30 GMT"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

ULS(통합 로깅 시스템) 로그의 로그 항목 예:

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation CSOM aii1c Verbose Checking   
SPBasePermissions.Open permission  

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation Authentication Authorization ajmmu   
Medium Permission check failed. asking for 0x10000, have 0x2000000000 645f0edc-7ec9-44c5-84b7-  
2adfba2f7f92  

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation CSOM afxwb High  
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at   
Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at   
Microsoft.SharePoint.SPSecurableObject.CheckPermissions(SPBasePermissions permissionMask) at   
Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest() at   
Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1   
pendingDisposableContainer)  

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation CSOM agmjp High Original error:  
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at   
Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at   
Microsoft.SharePoint.SPSecurableObject.CheckPermissions(SPBasePermissions permissionMask) at   
Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest() at   
Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1   
pendingDisposableContainer)   

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Portal Server Microfeeds aizmo Medium   
SocialRESTExceptionProcessingHandler.DoServerExceptionProcessing - SharePoint Server Exception   
[System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at   
Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at   
Microsoft.SharePoint.SPSecurableObject.CheckPermissions(SPBasePermissions permissionMask) at   
Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest() at   
Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1   
pendingDisposableContainer)] 645f0edc-7ec9-44c5-84b7-2adfba2f7f92  

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation Claims Authentication af32v Verbose   
Claims Windows Sign-In: Sending 401 for request  
'http://<;servername>;:30079/_vti_bin/client.svc/web/lists/getbyid(guid'<GUID>')' because the request is not from a browser.   

15:54:30.25 w3wp.exe (0x9FCC) 0x5F78 SharePoint Foundation Authentication Authorization alkvd   
Medium Throw UnauthorizedAccessException instead of SPUtilityInternal.Send401 for client.svc request.      

상태

Microsoft는 2016년 3월 누적 업데이트(v. 15.0.4805.1000) 이전의 SharePoint 팜 버전에서 문제가 되었음을 확인했습니다.

참조

SharePoint 업데이트

아직 해결되지 않았습니까? SharePoint 커뮤니티로 이동합니다.