Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

HttpContext.GetTokenAsync fails after Upgrade to 2.1.0 #1765

@TimHess

Description

@TimHess

Hello,
I have some code that's calling await HttpContext.GetTokenAsync("access_token"). When using Microsoft.AspNetCore.Authentication.JwtBearer version 2.0.4 it works, but upgrading to 2.1.0-preview1-final or newer results in null being returned.

I believe this is because on line 73 in Microsoft.AspNetCore.Authentication.Core/AuthenticationService.cs
return AuthenticateResult.Success(new AuthenticationTicket(transformed, result.Properties, result.Ticket.AuthenticationScheme)); result.Properties is null.

When using JwtBearer auth, result.Properties is never set - however, the properties that are expected to be there are present on result.Ticket. Changing line 73 to return AuthenticateResult.Success(new AuthenticationTicket(transformed, result.Ticket.Properties, result.Ticket.AuthenticationScheme)); appears to fix the issue for me, is there any reason not to do so?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions