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

TwitterHandler doesnt save all tokens as claims when SaveTokensAsClaims is true #632

Closed
@SHAGGAR

Description

TwitterHandler only adds the AccessToken to the list of claims and does not add the AccessTokenSecret.
Current:

if (Options.SaveTokensAsClaims)
{
    identity.AddClaim(new Claim("access_token", accessToken.Token, ClaimValueTypes.String, Options.ClaimsIssuer));
}

Should this not be

if (Options.SaveTokensAsClaims)
{
    identity.AddClaim(new Claim("access_token", accessToken.Token, ClaimValueTypes.String, Options.ClaimsIssuer));
    identity.AddClaim(new Claim("access_token_secret", accessToken.TokenSecret, ClaimValueTypes.String, Options.ClaimsIssuer));
}

Instead?

A workaround for this is to use the OnCreatingTicket event to add the claims yourself after authentication, but it would be way more convenient if all the claims were there when SaveTokensAsClaims is true.

Also would it be worthwhile to add some constants for the token ClaimTypes ?

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions