Exemplo n.º 1
0
 private async Task <Option <JwtPayload> > GenerateIdTokenPayload(
     ClaimsPrincipal claimsPrincipal,
     AuthorizationParameter authorizationParameter,
     string?issuerName,
     CancellationToken cancellationToken)
 {
     return(authorizationParameter.Claims != null &&
            authorizationParameter.Claims.IsAnyIdentityTokenClaimParameter()
             ? await _jwtGenerator.GenerateFilteredIdTokenPayload(
                claimsPrincipal,
                authorizationParameter,
                authorizationParameter.Claims.IdToken,
                issuerName,
                cancellationToken)
            .ConfigureAwait(false)
             : await _jwtGenerator.GenerateIdTokenPayloadForScopes(
                claimsPrincipal,
                authorizationParameter,
                issuerName,
                cancellationToken)
            .ConfigureAwait(false));
 }