public SessionHandleService(IHttpContextAccessor httpContext,
                             HttpClient httpClient,
                             SchemeOwnerIdentityProviderOptions idpOptions,
                             SpaOptions spaOptions,
                             PartyDetailsOptions partyDetailsOptions)
 {
     _httpContext         = httpContext;
     _httpClient          = httpClient;
     _idpOptions          = idpOptions;
     _spaOptions          = spaOptions;
     _partyDetailsOptions = partyDetailsOptions;
 }
 protected void AddSpaPolicy(SchemeOwnerIdentityProviderOptions options)
 {
     MvcCoreBuilder.AddAuthorization(opt =>
     {
         opt.AddPolicy(SpaConstants.SpaPolicy,
                       policy =>
         {
             if (options.Enable)
             {
                 policy.RequireClaim("scope", options.Scope);
             }
             else
             {
                 policy.RequireAssertion(_ => true);
             }
         });
     });
 }
 public TokenService(
     IClaimsService claimsProvider,
     IReferenceTokenStore referenceTokenStore,
     ITokenCreationService creationService,
     IHttpContextAccessor contextAccessor,
     ISystemClock clock,
     ILogger <TokenService> logger,
     PartyDetailsOptions partyDetailsOptions,
     SchemeOwnerIdentityProviderOptions idpOptions)
 {
     _context             = contextAccessor;
     _claimsProvider      = claimsProvider;
     _referenceTokenStore = referenceTokenStore;
     _creationService     = creationService;
     _clock  = clock;
     _logger = logger;
     _partyDetailsOptions = partyDetailsOptions;
     _idpOptions          = idpOptions;
 }
        public static SchemeOwnerIdentityProviderOptions AddSchemeOwnerIdentityProviderOptions(this IServiceCollection services,
                                                                                               IConfiguration configuration)
        {
            SchemeOwnerIdentityProviderOptions options;
            var schemeOwnerIdentityProviderOptions = configuration["SchemeOwnerIdentityProvider:Enable"];

            if (schemeOwnerIdentityProviderOptions == null)
            {
                options = new SchemeOwnerIdentityProviderOptions {
                    Enable = false
                };
                services.AddSingleton(options);
            }
            else
            {
                options = services.ConfigureOptions <SchemeOwnerIdentityProviderOptions>(configuration, "SchemeOwnerIdentityProvider");
            }
            return(options);
        }
 public TokenSignatureVerifier(SchemeOwnerIdentityProviderOptions idpOptions)
 {
     _idpOptions = idpOptions;
 }