问题描述
我在Visual Studio 2017 RC上创建了一个新的MVC项目。 我使用的是.NET核心版本1.0.1。
我正在尝试创建JwtToken来验证Power BI Embedded Service。 但是缺少HMAC库和整个Identity dll集。 任何想法以及如何使其发挥作用。
var signingKey = new SymmetricSecurityKey(key);
            VAR signingCredentials =新SigningCredentials(新InMemorySymmetricSecurityKey(键),SecurityAlgorithms.HmacSha256Signature,SecurityAlgorithms.Sha256Digest);
          &NBSP ; VAR标记=新JwtSecurityToken(this.Issuer,this.Audience,this.Claims,DateTime.UtcNow,this.Expiration,signingCredentials);
  &NBSP ;        返回新JwtSecurityTokenHandler()WriteToken(令牌);
I created a new MVC project on Visual Studio 2017 RC. I am using .NET core version 1.0.1.
I am trying to create JwtToken to authenticate Power BI Embedded Service. However the HMAC library and whole Identity dlls set is missing. Any idea and how to get this working.
var signingKey = new SymmetricSecurityKey(key);
var signingCredentials = new SigningCredentials(new InMemorySymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature, SecurityAlgorithms.Sha256Digest);
var token = new JwtSecurityToken(this.Issuer, this.Audience, this.Claims, DateTime.UtcNow, this.Expiration, signingCredentials);
return new JwtSecurityTokenHandler().WriteToken(token);
这篇关于.NET核心缺少HMAC和Identity dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!