Exemple #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="identityProviderStore"></param>
 /// <param name="mapper"></param>
 /// <param name="distributedCache"></param>
 public IdentityProvidersController(IOspIdentityProviderStore identityProviderStore, IMapper mapper,
                                    IDistributedWithPubSubCache distributedCache)
 {
     _identityProviderStore = identityProviderStore;
     _mapper           = mapper;
     _distributedCache = distributedCache;
 }
Exemple #2
0
 public UserSchemaService(ISystemContext systemContext, UserManager <OspUser> userManager,
                          RoleManager <OspRole> roleManager, IOspClientStore clientStore, IOspResourceStore resourceStore,
                          IOspIdentityProviderStore ospIdentityProviderStore, IOptions <OspIdentityOptions> ospIdentityOptions)
 {
     _systemContext            = systemContext;
     _userManager              = userManager;
     _roleManager              = roleManager;
     _clientStore              = clientStore;
     _resourceStore            = resourceStore;
     _ospIdentityProviderStore = ospIdentityProviderStore;
     _ospIdentityOptions       = ospIdentityOptions.Value;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sgIdentityProviderStore">Data storage of identity providers</param>
        /// <param name="schemeProvider">Scheme provider</param>
        /// <param name="authSchemeCreatorFactory">Factory to resolve creators of auth providers.</param>
        /// <param name="distributedCache">Memory cache do distribute events (if identity providers has changed.</param>
        public DynamicAuthSchemeService(IOspIdentityProviderStore sgIdentityProviderStore,
                                        IAuthenticationSchemeProvider schemeProvider,
                                        IAuthSchemeCreatorFactory authSchemeCreatorFactory,
                                        IDistributedWithPubSubCache distributedCache)
        {
            _sgIdentityProviderStore  = sgIdentityProviderStore;
            _schemeProvider           = schemeProvider;
            _authSchemeCreatorFactory = authSchemeCreatorFactory;

            var channel = distributedCache.Subscribe <string>(CacheCommon.KeyIdentityProviderUpdate);

            channel.OnMessage(async message => { await ConfigureAsync(); });
        }