Auth0 Home Blog Docs

OWIN Web Auth Identifier Bug



Currently following this article ( to use the token issued from Auth0 to authorize my C# Web Api. It is currently not working with error 'Cannot convert from string to System.IdentityModel.Tokens.SecurityKeyIdentifier. Here is the code:

using Microsoft.AspNetCore.Builder;
using Microsoft.IdentityModel.Tokens;
using System.Configuration;
using Owin;
using Microsoft.Owin.Security.Jwt;
using Microsoft.Owin.Security;
using Auth0.Owin;
using Microsoft.Owin;

[assembly: OwinStartup(typeof(repAPI.Startup))]
namespace repAPI
public class Startup
    public void Configuration(IAppBuilder app)
        var domain = $"https://{ConfigurationManager.AppSettings["auth0:Domain"]}/";
        var apiIdentifier = ConfigurationManager.AppSettings["auth0:ApiIdentifier"];

        var keyResolver = new OpenIdConnectSigningKeyResolver(domain);
            new JwtBearerAuthenticationOptions
                AuthenticationMode = AuthenticationMode.Active,
                TokenValidationParameters = new TokenValidationParameters()
                    ValidAudience = apiIdentifier,
                    ValidIssuer = domain,
                    IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) => keyResolver.GetSigningKey(identifier) //this line is having problems