Ejemplo n.º 1
0
 private static TokenValidationParameters GetToKenValidationParameters(Models.TokenConfiguration tokenConfiguration)
 {
     return(new TokenValidationParameters
     {
         ValidateIssuerSigningKey = true,
         IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(tokenConfiguration.Secret)),
         ValidIssuer = tokenConfiguration.Issuer,
         ValidAudience = tokenConfiguration.Audience,
         ValidateIssuer = false,
         ValidateAudience = false
     });
 }
Ejemplo n.º 2
0
 public TokenService(IOptions <Models.TokenConfiguration> tokenConfig, Common.ITimeProvider timeProvider)
 {
     _tokenConfig  = tokenConfig.Value;
     _timeProvider = timeProvider;
 }