使用AAD身份验证提供程序获取当前登录的用户 [英] Get current logged user with AAD authentication provider

查看:106
本文介绍了使用AAD身份验证提供程序获取当前登录的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的网站,托管在Azure App Services上,在这里我按照建议的

I have a simple website, hosted on Azure App Services, where I enabled AAD authentication following the express setting as recommended here and it is correctly working.

现在,我想在导航栏上显示当前登录用户的用户名/电子邮件.我该怎么办?

Now I would like to show on navigation bar the username / email of current logged in user. How should I do?

应用程序是使用C#Asp.Net Core 1.0.4开发的

App is developed in C# Asp.Net Core 1.0.4

非常感谢您

推荐答案

您正在使用

App Service通过使用特殊标头将用户声明传递给您的应用程序.不允许外部请求设置这些标头,因此仅在由App Service设置时才存在.一些示例标头包括:

App Service passes user claims to your application by using special headers. External requests aren't allowed to set these headers, so they are present only if set by App Service. Some example headers include:

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