Exemplo n.º 1
0
        public OpenIddictOptions Get(string name)
        {
            var tenant = _tenantProvider.GetCurrentTenant();

            Lazy <OpenIddictOptions> Create() => new Lazy <OpenIddictOptions>(() => _optionsFactory.Create(name));

            return(_cache.GetOrAdd((name, tenant), _ => Create()).Value);
        }
        public void Configure(OpenIddictOptions options)
        {
            var tenant = _tenantProvider.GetCurrentTenant();

            // Create a tenant-specific data protection provider to ensure authorization codes,
            // access tokens and refresh tokens can't be read/decrypted by the other tenants.
            options.DataProtectionProvider = _dataProtectionProvider.CreateProtector(tenant);

            // Other tenant-specific options can be registered here.
        }