从Azure AD支持的.NET Framework MVC应用程序获取访问令牌

我有一个.NET Framework MVC应用程序,该应用程序已为基于会话的Azure AD配置了身份验证。用户登录后,我需要获取访问承载令牌和刷新令牌,以供前端用于Power BI javascript嵌入。我无法找到一种为此目的从服务器获取访问权限的方法。

以下是设置Start.Auth.cs的方式:

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

app.UseCookieAuthentication(new CookieAuthenticationOptions ());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                ClientId = clientId,Authority = authority,Redirecturi = redirecturi                    
            });

我需要一个基于用户的身份验证访问令牌来传递给Power BI javascript嵌入,以便标识用户,而不是基于客户端ID /客户端机密服务器的令牌。

wxfjf200806 回答:从Azure AD支持的.NET Framework MVC应用程序获取访问令牌

PowerBI团队提供了一个.NET Core示例。

https://github.com/microsoft/PowerBI-Developer-Samples/blob/../NetCore-Sample/Pages/Index.cshtml.cs

还有更多有关如何在查看时获取授权码的文档

本文链接:https://www.f2er.com/3134577.html

大家都在问