将Azure Directory用户绑定到asp.net应用程序数据库中的现有用户 [英] bind Azure Directory user to existing user in asp.net application database

查看:92
本文介绍了将Azure Directory用户绑定到asp.net应用程序数据库中的现有用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在研究使用表单身份验证和asp.net身份的asp.net应用程序.现在,还可以通过Azure Active Directory进行连接.当用户通过AD连接时,他将被重定向到应用程序,并且仅有的信息 我有它的电子邮件地址(他的Microsoft帐户).

I'm working on asp.net application that uses forms authentication and asp.net Identity. Now,it is also possible to connect by Azure Active Directory. When a user connects through AD, he is redirected to the application and the only information I have it's email address (his microsoft account). 

我试图获取userId和用户名,但它们仍然为空.

I tried to get userId, username but they are still null.

我尝试过:

  var UserManager = new UserManager();
    UserManager.FindByEmail(User.Identity.GetEmail());

但是,user.identity没有GetEmail()的定义.

But, user.identity doesn,t have a definition for GetEmail().

因此,我想知道如何将此用户(通过AD连接)绑定到应用程序数据库中包含的他的信息.
请帮助.

So, I would like to know how to bind this user(connected  through AD) to his information contained in the applcation's database.
Need help please.

推荐答案

您发布的查询与Azure AD不完全相关. asp.net专家将为您的问题提供最佳答案.建议您在此处开始新话题-https://forums.asp.net/25.aspx/1?与正确的专家联系的安全性.

The query you've posted is not completely related to Azure AD. Your question will be best answered by asp.net experts. Suggest you to start a new thread here - https://forums.asp.net/25.aspx/1?Security to connect with the right experts.


这篇关于将Azure Directory用户绑定到asp.net应用程序数据库中的现有用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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