我有一个Azure Framework MVC应用程序,它为基于会话的.NET 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 embedding,以便用户被识别,而不是基于客户端id /客户端秘密服务器的令牌。
发布于 2019-11-09 09:52:29
PowerBI团队提供了一个.NET核心示例。
https://github.com/microsoft/PowerBI-Developer-Samples/blob/../NetCore-Sample/Pages/Index.cshtml.cs
查看时,还有更多关于如何获取授权码的文档
https://stackoverflow.com/questions/58775064
复制相似问题