简体   繁体   English

Azure AD Token generaiton using reactjs, to access WebAPI and SharePoint REST API/GrapAPI using jwt token

[英]Azure AD Token generaiton using reactjs, to access WebAPI and SharePoint REST API/GrapAPI using jwt token

We have react site, that is generating jwt token and talking to API using adal.我们有反应站点,即生成 jwt 令牌并使用 adal 与 API 交谈。 Now we need to upload files to the SharePoint library.现在我们需要将文件上传到 SharePoint 库。

If this possible using adal?如果这可能使用adal? how?如何? any sample please?请问有样品吗?

Currently we have created demo app using msal it generates access token and Id token, Id token works for API and access token works for MSGraph API, BUT login happens using popup.目前我们已经使用 msal 创建了演示应用程序,它生成访问令牌和 Id 令牌,Id 令牌适用于 API,访问令牌适用于 MSGraph API,但使用弹出窗口进行登录。 When I changes popup to Redirect, so after login it keep redirecting site.当我将弹出窗口更改为重定向时,登录后它会继续重定向站点。 refer known Issue 参考已知问题

I am stuck redirect is creating issue and if I try SuncWeek-react-aad-msal everything is good, BUT Token working for API but NOT GraphAPI, I tried putting scope https://graph.microsoft.com/Sites.Manage.All and added access in Azure app registration also, but NO LUCK我被卡住重定向正在创建问题,如果我尝试SuncWeek-react-aad-msal一切都很好,但是令牌适用于 API 但不是 GraphAPI,我尝试将 scope Z5E056C500A1C4B6A7110B5.microsoftD508B6A7110B5.并在 Azure 应用程序注册中添加了访问权限,但没有运气

any help is much appreciated TA.任何帮助都非常感谢 TA。

For requesting access token with specific for Microsoft graph using MSAL library, you can just give scopes like Site.Manage.all , You may refer samples here for various platform.对于使用 MSAL 库请求特定于 Microsoft 图形的访问令牌,您可以只提供Site.Manage.all类的范围,您可以在此处参考各种平台的示例

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

相关问题 如何在 ReactJS 上使用 JWT 令牌注销 - How logout using JWT token on ReactJS Firebase 在 ReactJS 应用程序中使用 JWT 令牌进行身份验证 - Firebase Authentication Using JWT token in ReactJS App 如何使用 JWT 和 Azure 广告令牌授权 API 端点? - How to authorize an API endpoint with both JWT and Azure Ad token? 如何使用 reactjs 中的 jwt-decode 库解码 JWT 令牌 - How to decode JWT token by using jwt-decode library in reactjs Jhipster Azure AD 访问令牌 - Jhipster Azure AD Access token 如何使用 Prisma API 生成 JWT 令牌? - How to generate the JWT token using Prisma API? 如何修复“访问令牌来自错误的受众或资源”。 尝试使用MSAL令牌访问Azure的REST api时 - How do I fix 'The access token is from wrong audience or resource.' when trying to access Azure's REST api using an MSAL token 尝试在令牌过期后使用 ReactJs 调用令牌 API - Trying to call the token API after token expires using ReactJs 使用API​​时如何通过reactjs传递JsonWebToken x-access-token? - How to pass JsonWebToken x-access-token through reactjs while using API? 使用Azure AD,ReactJS和NodeJS对用户进行身份验证并使用Graph API - Authenticate Users and use Graph API using Azure AD, ReactJS and NodeJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM