You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were getting the below error in one of our projects.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
We resolved it by changing the example LegacyOAuthSecurityTokenHandler to return validatedToken = new DummyWebToken();instead of validatedToken = default(SecurityToken);
public class DummyWebToken : SecurityToken
{
public override string Id => "Id";
public override string Issuer => "Issuer";
public override DateTime ValidFrom => new DateTime();
public override DateTime ValidTo => new DateTime();
public override SecurityKey SecurityKey => throw new NotImplementedException();
public override SecurityKey SigningKey { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
}
The text was updated successfully, but these errors were encountered:
We were getting the below error in one of our projects.
We resolved it by changing the example LegacyOAuthSecurityTokenHandler to return
validatedToken = new DummyWebToken();
instead ofvalidatedToken = default(SecurityToken);
The text was updated successfully, but these errors were encountered: