public AccountController(
     UserManager<ApplicationUser> userManager,
     IPersistedGrantService persistedGrantService,
     SignInManager<ApplicationUser> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     ILoggerFactory loggerFactory,
     IIdentityServerInteractionService interaction,
     IClientStore clientStore)
 {
     _userManager = userManager;
     _persistedGrantService = persistedGrantService;
     _signInManager = signInManager;
     _emailSender = emailSender;
     _smsSender = smsSender;
     _logger = loggerFactory.CreateLogger<AccountController>();
     _interaction = interaction;
     _clientStore = clientStore;
 }
Esempio n. 2
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     RoleManager <ApplicationRole> roleManager,
     IPersistedGrantService persistedGrantService,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     ILoggerFactory loggerFactory,
     IIdentityServerInteractionService interaction,
     IClientStore clientStore,
     ClientSelector clientSelector)
 {
     _userManager           = userManager;
     _roleManager           = roleManager;
     _persistedGrantService = persistedGrantService;
     _signInManager         = signInManager;
     _emailSender           = emailSender;
     _smsSender             = smsSender;
     _logger         = loggerFactory.CreateLogger <AccountController>();
     _interaction    = interaction;
     _clientStore    = clientStore;
     _clientSelector = clientSelector;
 }
Esempio n. 3
0
 public DefaultIdentityServerInteractionService(
     IdentityServerOptions options,
     IHttpContextAccessor context,
     IMessageStore <LogoutMessage> logoutMessageStore,
     IMessageStore <ErrorMessage> errorMessageStore,
     IMessageStore <ConsentResponse> consentMessageStore,
     IPersistedGrantService grants,
     IClientSessionService clientSessionService,
     ISessionIdService sessionIdService,
     ReturnUrlParser returnUrlParser,
     ILogger <DefaultIdentityServerInteractionService> logger)
 {
     _options             = options;
     _context             = context;
     _logoutMessageStore  = logoutMessageStore;
     _errorMessageStore   = errorMessageStore;
     _consentMessageStore = consentMessageStore;
     _grants = grants;
     _clientSessionService = clientSessionService;
     _sessionIdService     = sessionIdService;
     _returnUrlParser      = returnUrlParser;
     _logger = logger;
 }
Esempio n. 4
0
        public AccountController(
            UserManager <ApplicationUser> userManager,
            IPersistedGrantService persistedGrantService,
            SignInManager <ApplicationUser> signInManager,
            IEmailSender emailSender,
            ILoggerFactory loggerFactory,
            IIdentityServerInteractionService interaction,
            IClientStore clientStore,
            IStringLocalizerFactory factory)
        {
            _userManager           = userManager;
            _persistedGrantService = persistedGrantService;
            _signInManager         = signInManager;
            _emailSender           = emailSender;
            _logger      = loggerFactory.CreateLogger <AccountController>();
            _interaction = interaction;
            _clientStore = clientStore;

            var type         = typeof(SharedResource);
            var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);

            _sharedLocalizer = factory.Create("SharedResource", assemblyName.Name);
        }
Esempio n. 5
0
 /// <summary>
 /// Creates an instance of <see cref="UsersController"/>.
 /// </summary>
 /// <param name="userManager">Provides the APIs for managing user in a persistence store.</param>
 /// <param name="roleManager">Provides the APIs for managing roles in a persistence store.</param>
 /// <param name="dbContext">Class for the Entity Framework database context used for identity.</param>
 /// <param name="persistedGrantService">Implements persisted grant logic.</param>
 /// <param name="clientStore">Retrieval of client configuration.</param>
 /// <param name="apiEndpointsOptions">Options for configuring the IdentityServer API feature.</param>
 /// <param name="eventService">Models the event mechanism used to raise events inside the IdentityServer API.</param>
 /// <param name="generalSettings">General settings for an ASP.NET Core application.</param>
 /// <param name="localizer">Represents an <see cref="IStringLocalizer"/> that provides strings for <see cref="UsersController"/>.</param>
 /// <param name="configurationDbContext">Extended DbContext for the IdentityServer configuration data.</param>
 public UsersController(
     ExtendedUserManager <User> userManager,
     RoleManager <Role> roleManager,
     ExtendedIdentityDbContext <User, Role> dbContext,
     IPersistedGrantService persistedGrantService,
     IClientStore clientStore,
     IdentityServerApiEndpointsOptions apiEndpointsOptions,
     Indice.Services.IPlatformEventService eventService,
     IOptions <GeneralSettings> generalSettings,
     IStringLocalizer <UsersController> localizer,
     ExtendedConfigurationDbContext configurationDbContext
     )
 {
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _roleManager            = roleManager ?? throw new ArgumentNullException(nameof(roleManager));
     _dbContext              = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     _persistedGrantService  = persistedGrantService ?? throw new ArgumentNullException(nameof(persistedGrantService));
     _clientStore            = clientStore ?? throw new ArgumentNullException(nameof(clientStore));
     _apiEndpointsOptions    = apiEndpointsOptions ?? throw new ArgumentNullException(nameof(apiEndpointsOptions));
     _eventService           = eventService ?? throw new ArgumentNullException(nameof(eventService));
     _generalSettings        = generalSettings?.Value ?? throw new ArgumentNullException(nameof(generalSettings));
     _localizer              = localizer ?? throw new ArgumentNullException(nameof(localizer));
     _configurationDbContext = configurationDbContext ?? throw new ArgumentNullException(nameof(configurationDbContext));
 }
Esempio n. 6
0
 public AuthorizeResponseGenerator(ILogger <AuthorizeResponseGenerator> logger, ITokenService tokenService, IPersistedGrantService grants, IEventService events)
 {
     _logger       = logger;
     _tokenService = tokenService;
     _grants       = grants;
     _events       = events;
 }
Esempio n. 7
0
        public TokenValidator(IdentityServerOptions options, IHttpContextAccessor context, IClientStore clients, IPersistedGrantService grants, ICustomTokenValidator customValidator, IKeyMaterialService keys, ILogger <TokenValidator> logger)
        {
            _options         = options;
            _context         = context;
            _clients         = clients;
            _grants          = grants;
            _customValidator = customValidator;
            _keys            = keys;
            _logger          = logger;

            _log = new TokenValidationLog();
        }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultConsentService" /> class.
 /// </summary>
 /// <param name="grants">The grants.</param>
 /// <exception cref="System.ArgumentNullException">store</exception>
 public DefaultConsentService(IPersistedGrantService grants)
 {
     _grants = grants;
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultRefreshTokenService" /> class.
 /// </summary>
 /// <param name="grants">The grants store.</param>
 /// <param name="events">The events.</param>
 public DefaultRefreshTokenService(IPersistedGrantService grants, IEventService events, ILogger <DefaultRefreshTokenService> logger)
 {
     _logger = logger;
     _grants = grants;
     _events = events;
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultTokenService" /> class. This overloaded constructor is deprecated and will be removed in 3.0.0.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="claimsProvider">The claims provider.</param>
 /// <param name="grants">The grants.</param>
 /// <param name="creationService">The signing service.</param>
 /// <param name="events">The events service.</param>
 /// <param name="logger">The logger.</param>
 public DefaultTokenService(IHttpContextAccessor context, IClaimsService claimsProvider, IPersistedGrantService grants, ITokenCreationService creationService, IEventService events, ILogger <DefaultTokenService> logger)
 {
     _logger          = logger;
     _context         = context;
     _claimsProvider  = claimsProvider;
     _grants          = grants;
     _creationService = creationService;
     _events          = events;
 }
 public PersistedGrantController(IPersistedGrantService persistedGrantService)
 {
     _persistedGrantService = persistedGrantService;
 }
Esempio n. 12
0
        public static TokenRequestValidator CreateTokenRequestValidator(
            IdentityServerOptions options = null,
            IScopeStore scopes            = null,
            IPersistedGrantService grants = null,
            IResourceOwnerPasswordValidator resourceOwnerValidator = null,
            IProfileService profile = null,
            IEnumerable <IExtensionGrantValidator> extensionGrantValidators = null,
            ICustomTokenRequestValidator customRequestValidator             = null,
            ScopeValidator scopeValidator = null)
        {
            if (options == null)
            {
                options = TestIdentityServerOptions.Create();
            }

            if (scopes == null)
            {
                scopes = new InMemoryScopeStore(TestScopes.Get());
            }

            if (resourceOwnerValidator == null)
            {
                resourceOwnerValidator = new TestResourceOwnerPasswordValidator();
            }

            if (profile == null)
            {
                profile = new TestProfileService();
            }

            if (customRequestValidator == null)
            {
                customRequestValidator = new DefaultCustomTokenRequestValidator();
            }

            ExtensionGrantValidator aggregateExtensionGrantValidator;

            if (extensionGrantValidators == null)
            {
                aggregateExtensionGrantValidator = new ExtensionGrantValidator(new[] { new TestGrantValidator() }, TestLogger.Create <ExtensionGrantValidator>());
            }
            else
            {
                aggregateExtensionGrantValidator = new ExtensionGrantValidator(extensionGrantValidators, TestLogger.Create <ExtensionGrantValidator>());
            }

            if (grants == null)
            {
                grants = CreateGrantService();
            }

            if (scopeValidator == null)
            {
                scopeValidator = new ScopeValidator(scopes, new LoggerFactory().CreateLogger <ScopeValidator>());
            }

            return(new TokenRequestValidator(
                       options,
                       grants,
                       resourceOwnerValidator,
                       profile,
                       aggregateExtensionGrantValidator,
                       customRequestValidator,
                       scopeValidator,
                       new TestEventService(),
                       TestLogger.Create <TokenRequestValidator>()));
        }
Esempio n. 13
0
 public AuthCenterTestController(IClientStore clientStore, IResourceStore resourceStore, IPersistedGrantService persistedGrantService)
 {
     _clientStore           = clientStore;
     _resourceStore         = resourceStore;
     _persistedGrantService = persistedGrantService;
 }
Esempio n. 14
0
 public AccountController(UserManager <AppUser> userManager, SignInManager <AppUser> signInManager, IIdentityServerInteractionService interaction, IPersistedGrantService persistedGrantService, IEmailSender emailSender)
 {
     _userManager           = userManager;
     _signInManager         = signInManager;
     _interaction           = interaction;
     _persistedGrantService = persistedGrantService;
     _emailSender           = emailSender;
 }
Esempio n. 15
0
 public LogoutModel(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IIdentityServerInteractionService interaction, IPersistedGrantService persistedGrantService)
 {
     _userManager           = userManager;
     _signInManager         = signInManager;
     _interaction           = interaction;
     _persistedGrantService = persistedGrantService;
 }