src/AspNet.Security.OAuth.EVEOnline/EVEOnlineAuthenticationHandler.cs
/// <summary>
/// Extracts the claims from the token received from the token endpoint.
/// </summary>
/// <param name="token">The token to extract the claims from.</param>
/// <returns>
/// An <see cref="IEnumerable{Claim}"/> containing the claims extracted from the token.
/// </returns>
Extracts the claims from the token received from the token endpoint.
Extracts the claims from the token received from the token endpoint .
protected virtual IEnumerable<Claim> ExtractClaimsFromToken([NotNull] string token)
    {
        try
        {
            var securityToken = Options.SecurityTokenHandler.ReadJsonWebToken(token);
            var nameClaim = ExtractClaim(securityToken, "name");
            var expClaim = ExtractClaim(securityToken, "exp");
            var claims = new List<Claim>(securityToken.Claims);
            claims.Add(new Claim(ClaimTypes.NameIdentifier, securityToken.Subject.Replace("CHARACTER:EVE:", string.Empty, StringComparison.OrdinalIgnoreCase), ClaimValueTypes.String, ClaimsIssuer));
            claims.Add(new Claim(ClaimTypes.Name, nameClaim.Value, ClaimValueTypes.String, ClaimsIssuer));
            claims.Add(new Claim(ClaimTypes.Expiration, UnixTimeStampToDateTime(expClaim.Value), ClaimValueTypes.DateTime, ClaimsIssuer));
            var scopes = claims.Where(x => string.Equals(x.Type, "scp", StringComparison.OrdinalIgnoreCase)).ToList();
            if (scopes.Count > 0)
            {
                claims.Add(new Claim(EVEOnlineAuthenticationConstants.Claims.Scopes, string.Join(' ', scopes.Select(x => x.Value)), ClaimValueTypes.String, ClaimsIssuer));
            }
            return claims;
        }
        catch (Exception ex)
        {
            throw new InvalidOperationException("Failed to parse JWT for claims from EVEOnline token.", ex);
        }
    }
protected virtual IEnumerable < Claim > ExtractClaimsFromToken ( [ NotNull ] string token ) { try { var securityToken = Options . SecurityTokenHandler . ReadJsonWebToken ( token ) ; var nameClaim = ExtractClaim ( securityToken , " " ) ; var expClaim = ExtractClaim ( securityToken , " " ) ; var claims = new List < Claim > ( securityToken . Claims ) ; claims . Add ( new Claim ( ClaimTypes . NameIdentifier , securityToken . Subject . Replace ( " " , string . Empty , StringComparison . OrdinalIgnoreCase ) , ClaimValueTypes . String , ClaimsIssuer ) ) ; claims . Add ( new Claim ( ClaimTypes . Name , nameClaim . Value , ClaimValueTypes . String , ClaimsIssuer ) ) ; claims . Add ( new Claim ( ClaimTypes . Expiration , UnixTimeStampToDateTime ( expClaim . Value ) , ClaimValueTypes . DateTime , ClaimsIssuer ) ) ; var scopes = claims . Where ( x => string . Equals ( x . Type , " " , StringComparison . OrdinalIgnoreCase ) ) . ToList ( ) ; if ( scopes . Count > 0 ) { claims . Add ( new Claim ( EVEOnlineAuthenticationConstants . Claims . Scopes , string . Join ( ' ' , scopes . Select ( x => x . Value ) ) , ClaimValueTypes . String , ClaimsIssuer ) ) ; } return claims ; } catch ( Exception ex ) { throw new InvalidOperationException ( " " , ex ) ; } }
Extracts the claims from the token received from the token endpoint.
Extracts the claims from the token received from the token endpoint .
An  containing the claims extracted from the token.
An containing the claims extracted from the token .
string
[NotNull]
token
The token to extract the claims from.
The token to extract the claims from .