在没有用户的情况下获得Microsoft Graph/在线共享点API的访问权限 [英] Get access without a user for Microsoft Graph/online share point API

查看:87
本文介绍了在没有用户的情况下获得Microsoft Graph/在线共享点API的访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已将我的应用程序注册在azure活动目录下.我已授予对"Microsoft Graph"的访问权限和在线Office 365共享点".

我已经实现了具有承载身份验证(需要通过身份验证令牌)的API(Node js).

在我的用户界面中,我正在验证用户身份,并将其令牌传递给API.一切都很好.

但是现在的要求是

1)我必须通过后端调度程序调用共享点API.由于没有可用的用户详细信息,因此我使用客户端凭据"生成了令牌.
但是当我传递该令牌时,它给我的错误是"= \",验证请求时出错.\; category = \" invalid_client \",

2)第二个要求是我有一个后端调度程序,该调度程序调用我的API.
因此,调度程序试图使用客户端证书"来生成令牌,但是它不起作用.我能够生成令牌,但是当我传递该令牌时,我会收到未经授权的消息

请帮忙.

Hi,

I have registered my app under azure active directory. I have granted permission to "Microsoft Graph" and "Office 365 sharepoint online".

I have implemented API (Node js) which has bearer authentication (need to pass authentication token).

In my UI I am authenticating user, and pass his token to API. everything working fine.

But now requirement is

1)  I have to call share point API, through my back end scheduler. As no user details are available, I have generated token using "Client Credential".
but when I pass that token its giving me error as "=\"There has been an error authenticating the request.\";category=\"invalid_client\"",

2) 2nd requirement is I have one back end scheduler, which call my API.
So Scheduler trying to generate token using "Client Credential", but its not working. I am able to generate token , but when I pass that token I am getting unauthorized message

Please help.

推荐答案

您需要使用Client Credentials授予,这将允许您的后端计划使用其自己的凭据(应用程序身份)代替用户的模拟来进行身份验证并在调用其他服务或网络API时获取访问令牌.请 请参阅在守护程序应用程序或长时间运行的过程中调用Web API 示例以获取实现细节.另外,请参考
You need to use the Client Credentials grant where which will permits your backend schedule to use it own credentials (app identity) instead of user's impersonation to authenticate and get access tokens when calling another service or web API.  Please refer to Calling a Web API in a daemon app or long-running process sample for the implementation details. Also, refer to Service to service calls using client credentials document to understand the flow.


这篇关于在没有用户的情况下获得Microsoft Graph/在线共享点API的访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆