2

I have integrated twilio and it has updated packages of jwt and now i am getting error for this UseJwtBearerAuthentication() method. How can i resolved this error as i cannot downgrade my packages since it has a dependency for twilio?


 private void ConfigureOAuthTokenConsumption(IAppBuilder app) {
    var issuer = ConfigurationManager.AppSettings["as:AngularHostURL"];
    string audienceId = ConfigurationManager.AppSettings["as:AudienceId"];
    byte[] audienceSecret = TextEncodings.Base64Url.Decode(ConfigurationManager.AppSettings["as:AudienceSecret"]);

        app.UseJwtBearerAuthentication(
            new JwtBearerAuthenticationOptions
            {
                AuthenticationMode = AuthenticationMode.Active,
                AllowedAudiences = new[] { audienceId },
                IssuerSecurityTokenProviders = new 
                    IIssuerSecurityTokenProvider[]
                {
                    new SymmetricKeyIssuerSecurityTokenProvider(issuer, 
                    audienceSecret)
                }
            }
        );
    }

The exception i am getting is:

Could not load type Could not load 
'System.IdentityModel.Tokens.TokenValidationParameters' from assembly 'System.IdentityModel.Tokens.Jwt, Version=5.1.2.0, 
Culture=neutral,  PublicKeyToken=31bf3856ad364e35'
Evandro Teixeira
  • 321
  • 3
  • 18
Jayant Belekar
  • 243
  • 1
  • 3
  • 9
  • hello i resolved this by updating my microsoft.owin.security to latest 4.0.0 and updated my code app.UseJwtBearerAuthentication( new JwtBearerAuthenticationOptions { AuthenticationMode = AuthenticationMode.Active, AllowedAudiences = new[] { audienceId }, IssuerSecurityKeyProviders = new IIssuerSecurityKeyProvider[] { new SymmetricKeyIssuerSecurityKeyProvider(issuer, audienceSecret) } }); – Jayant Belekar Mar 08 '19 at 10:23

0 Answers0