Security icon indicating copy to clipboard operation
Security copied to clipboard

[Announcement] OAuthBearer renamed to JwtBearer

Open afoliaco opened this issue 11 years ago • 3 comments

I was able to do this in beta7 but it change on beta8, please point how this change

app.UseOAuthBearerAuthentication(options =>
{
    options.Notifications = new OAuthBearerAuthenticationNotifications
    {
        AuthenticationFailed = notificaton =>
        {
            notificaton.HandleResponse();
            return Task.FromResult<object>(null);
        }
    };
});

afoliaco avatar Oct 21 '15 13:10 afoliaco

This was renamed to JwtBearer: https://github.com/aspnet/Security/blob/1.0.0-beta8/src/Microsoft.AspNet.Authentication.JwtBearer/

app.UseJwtBearerAuthentication(options =>
{
    options.Events = new JwtBearerEvents
    {
        OnAuthenticationFailed = context =>
        {
            context.HandleResponse();
            return Task.FromResult(0);
        }
    };
});

Tratcher avatar Oct 21 '15 16:10 Tratcher

thanks that did the trick

afoliaco avatar Oct 21 '15 20:10 afoliaco

[Leaving open for discussion]

Tratcher avatar Oct 21 '15 20:10 Tratcher