我正在使用 Azure AD 认证的 Azure Function。在 Azure 上部署后,一切都正常。
public static async Task<IActionResult> ExportT(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req, ClaimsPrincipal principal,
ILogger log)
{
var c = principal.Claims.Select(x => x.Value);
return new OkObjectResult(c);
}
返回:
[ "38a1e83b-c1d3-4fd7-bdc6-ef2447", "https://sts.windows.net/635e38ef-108e-4a26-b718-bbd532/", "1564501257", "1564501257", "1564505157", "42FgYFCuNWnL3ROWG9x3p4EzN3+c/6u8Gh5jV7sT0A", "pwd", "test", "test", "92.169.93", "test", "36fbab-425b-9d65-b2425ef3d9bf", "a1c1ee35-67ab-4f3a-2877c5580b1e", "ES_SALARIED", "XboeusxsxyvnjhCT_vJHkzncPE2JBU58Q50", "635e38ef-26-b718-bbd960991532", "testdedev@ins.coop", "testdedev@ins.coop", "PJ0vEo70o0G__HrwX8ghAA", "1.0" ]
但是在使用 VS2019 本地执行时,我遇到了以下问题:
[ "Admin" ]
有什么想法吗?
谢谢,