在登录时从 Azure Active Directory(react-native 应用程序)生成环回用户的最佳做法是什么? [英] What are the best practises for generating loopback users from Azure Active Directory on login (react-native application)?

查看:8
本文介绍了在登录时从 Azure Active Directory(react-native 应用程序)生成环回用户的最佳做法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 expo sdk 的 react-native 应用程序,使用 loopback 3 作为我的后端,我正在尝试添加 Azure Active Directory 授权和身份验证,以便我的用户可以使用他们的工作电子邮件和密码登录.

I have a react-native application with the expo sdk, using loopback 3 as my backend, which I'm trying to add Azure Active Directory authorization and authentication to, so that my users can login with their work email and password.

我什至不知道如何做到这一点以及使用什么技术.

I'm having with how I even do this and what technologies to use.

目前我有一个打开浏览器的按钮,可以验证和授权用户进行快速图形 api 调用并获取他们的用户数据,但我不知道如何处理这些信息

Currently I have a button which opens the browser and can authenticate and authorise a user to make a quick graph api call and fetch their user data, but I don't have a clue what to actually do with this information

如果有人以前这样做过,并且只是为我指出正确的方向,那就太好了.我浏览了一堆文档,但就是不知道怎么做.

If someone has done this before and just point me in the right direction that would be great. I have gone over a bunch of docs but just can't figure out how.

推荐答案

如您所述,您的应用向 azure 广告发出令牌请求,输入用户凭据后,您的应用使用获取的令牌访问图形 api 并然后图形 api 返回相关资源.

As you mentioned, your app makes a token request to the azure ad, after entering the user credential, your app uses the acquired token to access the graph api and then the graph api return the related resource.

如果您尝试过,您可以参考 v1 端点v2 端点.

For you tried, you could refer to oauth2.0 code grant flow, on v1 endpoint or v2 endpoint.

使用token调用ms graph api,可以参考这个文档.

For using token to call ms graph api, you could refer to this doc.

这篇关于在登录时从 Azure Active Directory(react-native 应用程序)生成环回用户的最佳做法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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