Пример #1
0
 public PasswordRecoveryController(AppDbContext context, IConfiguration config, EmailSender sender)
 {
     Context                  = context;
     Config                   = config;
     PasswordEncrypter        = new PasswordEncrypter(Config["EncryptionSalt"]);
     MinutesToRecoverPassword = 5;
     EmailSender              = sender;
     TokenStore               = new JwtTokenStore();
 }
Пример #2
0
 public AuthenticationController(AppDbContext context, IConfiguration config)
 {
     Context     = context;
     Config      = config;
     SecurityKey = Config["AuthenticationKey"] ?? "The little brown fox jumps over the lazy dog";
     LongLivedTokenTimeInSeconds  = 60 * 60 * 24 * 5;
     ShortLivedTokenTimeInSeconds = 60 * 60 * 1;
     SecurityKeyBuilder           = new SimpleKeyBuilder(SecurityKey);
     PasswordEncrypter            = new PasswordEncrypter(Config["EncryptionSalt"]);
     TokenStore = new JwtTokenStore();
 }
Пример #3
0
        private PaymentMethodConfirmation CreateConfirmationPayload(PaymentMethodPayload payload)
        {
            var tokenStore         = new JwtTokenStore();
            var keyBuilder         = new SimpleKeyBuilder(Guid.NewGuid().ToString());
            var permanentTokenLife = DateTime.Now.AddHours(1);
            var token = tokenStore.GiveToken(permanentTokenLife, keyBuilder, new List <Claim>());

            return(new PaymentMethodConfirmation {
                AssociationToken = token,
                OperationTokenFromProvider = payload.OperationTokenFromProvider
            });
        }