Ejemplo n.º 1
0
        public async Task <CreateTokenResult> CreateTokenAsync(CreateTokenOptions options)
        {
            var serverSecret = await _secretsProvider.GetSecretAsync();

            var secretKey = await _securityKeyProvider.CreateSecurityKeyAsync(serverSecret);

            var claims = await _claimsProvider.GetUserClaimsAsync(options.Username);

            var createTokenResult = await _jwtTokenProvider.CreateTokenAsync(claims, secretKey, _tokenServiceSettings.Issuer, options.Audience);

            return(createTokenResult);
        }