简体   繁体   English

新 O365 租户的 Sharepoint Online OAuth 2.0 无效令牌类型

[英]Sharepoint Online OAuth 2.0 invalid token type for new O365 tenant

I have been using Sharepoint Online REST API to integrate with my O365 AddIn app which is working perfectly fine for my Old O365 tenant.我一直在使用 Sharepoint Online REST API 与我的 O365 AddIn 应用程序集成,这对于我的旧 O365 租户来说非常好。 However I am getting an error while I am trying to call any API with the Bearer token that I get for my new O365 tenant app.但是,当我尝试使用为我的新 O365 租户应用程序获取的不记名令牌调用任何 API 时出现错误。

{"error":"invalid_request","error_description":"Token type is not allowed."}

Is the auth token URL changed for new tenants, or is it something else.新租户的身份验证令牌 URL 是否已更改,还是其他内容。

I am using https://accounts.accesscontrol.windows.net/{{tenant_id}}/tokens/OAuth/2我正在使用https://accounts.accesscontrol.windows.net/{{tenant_id}}/tokens/OAuth/2

Azure Access Control (ACS), a service of Azure Active Directory (Azure AD), got retired on November 7, 2018. This retirement doesn't impact the SharePoint Add-in model, which uses the https://accounts.accesscontrol.windows.net hostname (which isn't impacted by this retirement). Azure 访问控制 (ACS) 是 Azure Active Directory (Azure AD) 的一项服务,已于 2018 年 11 月 7 日停用。此停用不会影响使用https://accounts.accesscontrol的 SharePoint 外接程序模型。 windows.net主机名(不受此停用的影响)。

Check out Impact of Azure Access Control retirement for SharePoint add-ins .查看Azure 访问控制停用对 SharePoint 加载项的影响

Note that, you can connect SharePoint directly to Azure AD using token issuance policies .请注意,您可以使用令牌颁发策略将 SharePoint 直接连接到 Azure AD

SharePoint 2013, 2016, and SharePoint Online customers have long used ACS for authentication purposes in the cloud, on-prem, and hybrid scenarios. SharePoint 2013、2016 和 SharePoint Online 客户长期以来一直将 ACS 用于云、本地和混合方案中的身份验证目的。 Some SharePoint features and use cases will be affected by ACS retirement, while others will not.某些 SharePoint 功能和用例将受到 ACS 停用的影响,而另一些则不会。 The below table summarizes migration guidance for some of the most popular SharePoint feature that leverage ACS:下表总结了一些利用 ACS 的最流行的 SharePoint 功能的迁移指南:

  • Authenticating users from Azure AD从 Azure AD 对用户进行身份验证

    • Previously, Azure AD did not support SAML 1.1 tokens required by SharePoint for authentication, and ACS was used as an intermediary that made SharePoint compatible with Azure AD token formats.以前,Azure AD 不支持 SharePoint 进行身份验证所需的 SAML 1.1 令牌,而 ACS 被用作使 SharePoint 与 Azure AD 令牌格式兼容的中介。 Now, you can connect SharePoint directly to Azure AD using token issuance policies.现在,您可以使用令牌颁发策略将 SharePoint 直接连接到 Azure AD。
  • App authentication & server-to-server authentication in SharePoint on-prem or SharePoint Online – SharePoint add-in registrations done through appregnew.aspx etc.本地 SharePoint 或 SharePoint Online 中的应用程序身份验证和服务器到服务器身份验证 – 通过 appregnew.aspx 等完成的 SharePoint 加载项注册。

    • Not affected by ACS retirement;不受ACS退休影响; no changes necessary.无需更改。
  • Low trust authorization for SharePoint add-ins (provider hosted and SharePoint hosted) SharePoint 加载项的低信任授权(提供商托管和 SharePoint 托管)

    • Not affected by ACS retirement;不受ACS退休影响; no changes necessary.无需更改。
  • SharePoint cloud hybrid search SharePoint 云混合搜索

    • Not affected by ACS retirement;不受ACS退休影响; no changes necessary.无需更改。

We had the same issue when using app-only, ClientID / ClientSecret based authentication in a tenant, that was recently created.在最近创建的租户中使用仅应用程序、基于ClientID / ClientSecret的身份验证时,我们遇到了同样的问题。 In our old tenant (created in 2013) we could use the same authentication method without any problem.在我们的旧租户(创建于 2013 年)中,我们可以毫无问题地使用相同的身份验证方法。 As it turned out, new tenants have a standard setting in DisableCustomAppAuthentication property, that disable this kind of auth., however it can be overriden using this command:事实证明,新租户在DisableCustomAppAuthentication属性中有一个标准设置,禁用这种身份验证,但是可以使用以下命令覆盖它:

Set-SPOTenant -DisableCustomAppAuthentication $false

Source:来源:

https://sharepoint.stackexchange.com/questions/284402/sharepoint-online-authorization-issue-token-type-is-not-allowed https://sharepoint.stackexchange.com/questions/284402/sharepoint-online-authorization-issue-token-type-is-not-allowed

https://sharepoint.stackexchange.com/questions/286693/getting-invalid-request-token-type-is-not-allowed-error-while-accessing-lists https://sharepoint.stackexchange.com/questions/286693/getting-invalid-request-token-type-is-not-allowed-error-while-accessing-lists

Furthermore:此外:

https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs

Azure Access Control (ACS), a service of Azure Active Directory (Azure AD), has been retired on November 7, 2018. This retirement does not impact the SharePoint Add-in model, which uses the https://accounts.accesscontrol.windows.net hostname (which is not impacted by this retirement). Azure 访问控制 (ACS) 是 Azure Active Directory (Azure AD) 的一项服务,已于 2018 年 11 月 7 日停用。此停用不会影响使用https://accounts.accesscontrol的 SharePoint 外接程序模型。 windows.net主机名(不受此停用的影响)。 For more information, see Impact of Azure Access Control retirement for SharePoint Add-ins.有关详细信息,请参阅 Azure 访问控制停用对 SharePoint 外接程序的影响。 For new tenants, apps using an ACS app-only access token is disabled by default.对于新租户,默认情况下禁用使用 ACS 仅应用访问令牌的应用。 We recommend using the Azure AD app-only model which is modern and more secure.我们建议使用现代且更安全的仅 Azure AD 应用程序模型。 But you can change the behavior by running 'set-spotenant -DisableCustomAppAuthentication $false' (needs the latest SharePoint admin PowerShell).但是您可以通过运行“set-spotenant -DisableCustomAppAuthentication $false”来更改行为(需要最新的 SharePoint 管理 PowerShell)。

More details:更多细节:

https://www.koskila.net/literally-breaking-changes-to-app-authentication-on-sharepoint-%F0%9F%98%B5/ https://www.koskila.net/literally-break-changes-to-app-authentication-on-sharepoint-%F0%9F%98%B5/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在具有 MFA 的 O365 租户上,使用 Python 将文件夹上传到 Sharepoint - Uploading a folder to Sharepoint using Python, on an O365 tenant with MFA 无法使用 O365 Comm-Services 的 javascript 获取 azure OAuth2 令牌 - Unable to get azure OAuth2 token with javascript for O365 Comm-Services SMTP 到 O365 使用 OAUTH2 和 PHPMailer - SMTP to O365 using OAUTH2 and PHPMailer 与O365的OAuth集成失败,错误AADSTS65005 - OAuth integration with O365 fails with error AADSTS65005 使用 Powershell 将新的 O365 用户添加到 AD 组 - Add a new O365 users to AD group using Powershell 将 Power BI 服务管理员角色授予 AAD 服务主体到 O365 租户 - Grant Power BI Service Admin role to AAD Service Principal into O365 tenant Office365-列出O365用户而无需注册应用程序和生成令牌 - Office365 - List O365 users without registering application and generating token 无法使用 O365 API 的刷新令牌生成访问令牌 - Failure to generate access token using refresh token for O365 API 无法使用 o365 MS Graph API getPreviewLinkWithEdit 在线编辑 word 文档 - Unable to edit word document online using o365 MS Graph API getPreviewLinkWithEdit 用于 Exchange/O365 POP3 和 SMTP 的 2-Leged 客户端凭据 OAuth 流 - 2-Legged Client Credentials OAuth Flow for Exchange/O365 POP3 and SMTP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM