简体   繁体   English

提供令牌的 Dynamics CRM 401

[英]Dynamics CRM 401 with token provided

I'm working on a dynamics crm integration for a Single-Tenant Server-to-server authentication.我正在研究用于单租户服务器到服务器身份验证的动态 crm 集成。 This is required to obtain tokens invisibly as the data will be used to create customer facing ui.这是在无形中获取令牌所必需的,因为数据将用于创建面向客户的 ui。

Therefore I'm getting a token back from Azure using the client_credentials grant type.因此,我使用 client_credentials 授权类型从 Azure 取回令牌。 However when I attempt to use this token to access any dynamics endpoint (such as those documented here: https://msdn.microsoft.com/en-us/library/mt607871.aspx ) All I get back is a 401 - access denied.但是,当我尝试使用此令牌访问任何动态端点(例如此处记录的那些: https : //msdn.microsoft.com/en-us/library/mt607871.aspx )时,我得到的只是 401 - 访问被拒绝.

I've done the following:我做了以下工作:

  • Create an Azure application创建 Azure 应用程序

  • Created and stored a key创建并存储密钥

  • Enabled permissions for Dynamics CRM online为 Dynamics CRM online 启用权限

I've seen some suggestion that I need a service user in the CRM itself to provide access, however when I try and create one the options described do not appear.我已经看到一些建议,我需要 CRM 本身中的服务用户来提供访问权限,但是当我尝试创建一个时,所描述的选项没有出现。 (such as here: https://msdn.microsoft.com/en-us/library/mt790170.aspx#bkmk_ManuallyCreateUser ) (例如这里: https : //msdn.microsoft.com/en-us/library/mt790170.aspx#bkmk_ManuallyCreateUser

Can you suggest any steps I might be missing here?你能建议我在这里可能遗漏的任何步骤吗?

Heres a sample call using the token这是使用令牌的示例调用

{ method: 'GET',
url: 'https://<snip>/api/data/v8.2/accounts?$select=name&$top=3',
headers:
{ Authorization: 'Bearer <snip>',
Accept: 'application/json',
'OData-MaxVersion': '4.0',
'OData-Version': '4.0' }
}

EDIT: Please note that I am using node.js here and C# / .net based answers are probably not going to be massively helpful编辑:请注意,我在这里使用 node.js 并且基于 C#/.net 的答案可能不会有很大帮助

Here is a post on how to configure server to server auth .这是一篇关于如何配置服务器到服务器 auth的帖子。 Assuming you ran through all the steps except creating the application user, you can do so by:假设您完成了除创建应用程序用户之外的所有步骤,您可以通过以下方式实现:

  1. In CRM Navigate to Settings->Security->Users在 CRM 中导航到设置-> 安全-> 用户
  2. Change the view from "Enabled Users" to "Application Users"将视图从“启用的用户”更改为“应用程序用户”
  3. From the new user form change the form from "User" to "Application User".从新用户表单将表单从“用户”更改为“应用程序用户”。

在此处输入图片说明

You should now be able to create your application user.您现在应该能够创建您的应用程序用户。

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

相关问题 在Dynamics CRM中发送通知 - Send notifications in Dynamics CRM (msal-node) - Dynamics 365 Business Central 为具有已接收令牌的任何资源返回 401 - (msal-node) - Dynamics 365 Business Central returns 401 for any resource with received token Microsoft Dynamics CRM中活动的EntityLogicalName是什么 - What is the EntityLogicalName for activities in Microsoft Dynamics CRM 使用Node.js以编程方式将Web资源上载到Microsoft Dynamics CRM - Upload web resource to Microsoft Dynamics CRM programmatically with Node.js Dynamics CRM Online + Node.js(请求永远运行/挂起) - Dynamics CRM Online + Node.js (request runns forever /hangs) 提供的令牌无效或无效的状态令牌 - Token is Invalid or Invalid state token provided Passport-facebook-token 不断返回 401 - Passport-facebook-token keeps returning 401 错误:401:需要机器人令牌 - 电报 - Telegraf - Error: 401: Bot Token is required - Telegram - Telegraf PRISMA:身份验证令牌无效:未提供“授权”header - PRISMA: Authentication token is invalid: 'Authorization' header not provided DocuSign:提供的访问令牌已过期、被撤销或格式错误 - DocuSign: The access token provided is expired, revoked or malformed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM