Aracılığıyla paylaş


OAuth ve SAML talepleri kullanılırken "401 yetkisiz" hatası

Belirtiler

Aşağıdaki senaryoyu değerlendirin:

  • Grubunuzda bir kimlik doğrulama sağlayıcısı olarak Active Directory Federasyon Hizmetleri'ni (AD FS) kullanan Güvenlik Onayları Biçimlendirme Dili (SAML) talep türlerini kullanıyorsunuz.
  • Gruptaki Microsoft SharePoint 2013 sitelerindeki kullanıcılara izin vermek için Rol veya GroupSID talebi kullanıyorsunuz.
  • Grup sürümünüz 15.0.4805.1000 (Mart 2016 toplu güncelleştirmesi) sürümünden önceki bir sürümdür.

Bu senaryoda, Rol veya GroupSID talep türü aracılığıyla kendilerine uygun izinlere atanan kullanıcılar, aşağıdaki gibi durumlarda OAuth kimlik doğrulama yöntemini kullandıklarında "401 yetkisiz" hata iletileri alır:

  • İş Akışı Yöneticisi (SharePoint 2013 iş akışları)
  • Web Uygulaması Eşlikçisi (WAC - Office Web Apps)
  • Yüksek Güven veya Düşük Güven Sağlayıcısı Barındırılan Uygulamalar
  • Grup Grupları Arası Hizmet Uygulaması Yayımlama/Kullanma
  • Karma SharePoint 2013/SharePoint Online senaryoları
  • Exchange ve Lync 2013/Skype Kurumsal ile SharePoint Tümleştirmesi

Çözüm

Bu sorunu çözmek için gruptaki tüm sunuculara Microsoft SharePoint Server için Mart 2016 Toplu Güncelleştirmesi'ni yükleyin.

Düzeltmenin bir parçası olarak, SPTrustedIdentityTokenIssuer nesnesine yeni bir GroupClaimType özelliği eklenir. OAuth'un doğru çalışabilmesi için bu özelliğin Rol veya GroupSID talep türü aracılığıyla izin atanmış kullanıcılar için yetkilendirme için doğru talep türüne ayarlanması gerekir.

GroupClaimType özelliğini ayarlamak için aşağıdaki Windows PowerShell komutlarını çalıştırın:

#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()   

Daha Fazla Bilgi

Başarısız bir iş akışından örnek hata iletisi:

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)

Birleşik Günlük Sistemi (ULS) günlüğündeki örnek günlük girdileri:

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.      

Durum

Microsoft, Bunun Mart 2016 toplu güncelleştirmesi (v. 15.0.4805.1000) öncesi SharePoint grubu sürümlerinde bir sorun olduğunu doğruladı.

Başvurular

SharePoint Güncelleştirmeleri

Yine de yardım mı gerekiyor? SharePoint Topluluğu'na gidin.