Beispiel #1
0
 private TokenValidationParameters GetValidationParams(TokenConfigurationModel config)
 {
     return(new TokenValidationParameters
     {
         ValidateIssuer = true,
         ValidateAudience = true,
         ValidateLifetime = true,
         ValidateIssuerSigningKey = true,
         ValidIssuer = config.Issuer,
         ValidAudience = config.Audience,
         IssuerSigningKey = fRsa.ToSecurityKey(config.PublicKey, true),
         NameClaimType = Constants._NameClaim,
         RoleClaimType = Constants._RoleClaim
     });
 }
Beispiel #2
0
        public void Set(TokenConfigurationModel configuration)
        {
            if (configuration is null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            lock (fConfigurationSources)
            {
                fConfiguration = configuration;

                foreach (var source in fConfigurationSources)
                {
                    source.SetResult(configuration);
                }
            }
        }
 public TokenConfigurationChangedEvent(TokenConfigurationModel model, ILoggingContext context)
     : base(context)
 {
     Model = model;
 }
Beispiel #4
0
 public TokenAuthenticationService(IOptions <TokenConfigurationModel> tokenConfig, IUserRepository userRepository)
 {
     _tokenConfig     = tokenConfig.Value;
     _usersRepository = userRepository;
 }
 public TokenConfigurationChangedEvent(TokenConfigurationModel model, string scopeId, string?parentScopeId)
     : base(scopeId, parentScopeId)
 {
     Model = model;
 }