コード例 #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="userStore">LDAP User Store</param>
 /// <param name="events">IEventService</param>
 /// <param name="tools">IdentityServerTools</param>
 public LdapController(
     ILdapUserStore userStore,
     IEventService events,
     IdentityServerTools tools)
 {
     this.userStore = userStore;
     this.events    = events;
     this.tools     = tools;
 }
コード例 #2
0
        public ExternalController(
            IIdentityServerInteractionService interaction,
            IClientStore clientStore,
            IEventService events,
            ILogger <ExternalController> logger,
            ILdapUserStore users = null)
        {
            _users = users;

            _interaction = interaction;
            _clientStore = clientStore;
            _logger      = logger;
            _events      = events;
        }
コード例 #3
0
 public AccountController(
     IIdentityServerInteractionService interaction,
     IClientStore clientStore,
     IHttpContextAccessor httpContextAccessor,
     IAuthenticationSchemeProvider schemeProvider,
     IEventService events,
     ILdapUserStore userStore)
 {
     _interaction = interaction;
     _events      = events;
     _userStore   = userStore;
     // Should we modify in the service? good question...
     _account = new AccountService(interaction, httpContextAccessor, schemeProvider, clientStore);
 }
コード例 #4
0
        public AccountController(
            IIdentityServerInteractionService interaction,
            IClientStore clientStore,
            IAuthenticationSchemeProvider schemeProvider,
            IEventService events,
            ILdapUserStore users = null)
        {
            _users = users; // Should use the LdapStore.

            _interaction    = interaction;
            _clientStore    = clientStore;
            _schemeProvider = schemeProvider;
            _events         = events;
        }
コード例 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">Logger</param>
 /// <param name="events">Event service</param>
 /// <param name="interaction">Idsrc interaction service</param>
 /// <param name="schemeProvider">Authentication scheme provider</param>
 /// <param name="userStore">User store</param>
 /// <param name="clientStore">Client store</param>
 public AccountController(
     ILogger <AccountController> logger,
     IEventService events,
     IIdentityServerInteractionService interaction,
     IAuthenticationSchemeProvider schemeProvider,
     ILdapUserStore userStore,
     IClientStore clientStore)
 {
     this.logger         = logger;
     this.events         = events;
     this.interaction    = interaction;
     this.schemeProvider = schemeProvider;
     this.userStore      = userStore;
     this.clientStore    = clientStore;
 }
コード例 #6
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     RoleManager <ApplicationRole> roleManager,
     IPersistedGrantService persistedGrantService,
     SignInManager <ApplicationUser> signInManager,
     ILoggerFactory loggerFactory,
     IIdentityServerInteractionService interaction,
     IClientStore clientStore,
     ILdapUserStore userStore,
     IEventService events)
 {
     _userManager           = userManager;
     _roleManager           = roleManager;
     _persistedGrantService = persistedGrantService;
     _signInManager         = signInManager;
     _logger      = loggerFactory.CreateLogger <AccountController>();
     _interaction = interaction;
     _clientStore = clientStore;
     _userStore   = userStore;
     _events      = events;
 }
コード例 #7
0
 public AccountController(IIdentityServerInteractionService interaction, ILdapUserStore <LdapUser> users,
                          IEventService events, ILoginManager <LdapUser> login, IEmailService mail,
                          IViewRenderService viewRenderService, SigningCredentials signingCredentials)
 {
     this._interaction               = interaction;
     this._users                     = users;
     this._events                    = events;
     this._login                     = login;
     this._mail                      = mail;
     this._viewRenderService         = viewRenderService;
     this._signingCredentials        = signingCredentials;
     this._tokenValidationParameters = new TokenValidationParameters {
         ValidIssuer              = "https://account.vcp.sh",
         ValidateAudience         = false,
         IssuerSigningKey         = this._signingCredentials.Key,
         ValidateIssuerSigningKey = true,
         ValidateIssuer           = true,
         ValidateLifetime         = true,
         ValidateTokenReplay      = true
     };
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapUserProfileService"/> class.
 /// </summary>
 /// <param name="users">The users.</param>
 /// <param name="logger">The logger.</param>
 public LdapUserProfileService(ILdapUserStore users, ILogger <LdapUserProfileService> logger)
 {
     Users  = users;
     Logger = logger;
 }
コード例 #9
0
 public HostProfileService(ILdapUserStore users, ILogger <LdapUserProfileService> logger) : base(users, logger)
 {
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapUserResourceOwnerPasswordValidator{TUser}"/> class.
 /// </summary>
 /// <param name="users">The users.</param>
 /// <param name="clock">The clock.</param>
 public LdapUserResourceOwnerPasswordValidator(ILdapUserStore users, ISystemClock clock)
 {
     _users = users;
     _clock = clock;
 }
コード例 #11
0
        /// <summary>
        /// Adds Ldap Users to identity server.
        /// </summary>
        /// <typeparam name="TUserDetails">The type of the user details.</typeparam>
        /// <typeparam name="TCustomUserStore">The type of the custom user store.</typeparam>
        /// <param name="builder">The builder.</param>
        /// <param name="configuration">The ldap configuration.</param>
        /// <param name="customUserStore">The custom user store (ILdapUserStore).</param>
        /// <returns>
        /// Returns the builder instance
        /// </returns>
        public static IIdentityServerBuilder AddLdapUsers <TUserDetails, TCustomUserStore>(this IIdentityServerBuilder builder, IConfiguration configuration, ILdapUserStore customUserStore)
            where TUserDetails : IAppUser, new()
        {
            RegisterLdapConfigurations(builder, configuration);
            builder.Services.AddSingleton <ILdapService <TUserDetails>, LdapService <TUserDetails> >();

            // For testing purpose we can use the in memory. In reality it's better to have
            // your own implementation. An example with Redis exists in the repository
            builder.Services.AddSingleton(customUserStore);

            builder.AddProfileService <LdapUserProfileService <TUserDetails> >();
            builder.AddResourceOwnerValidator <LdapUserResourceOwnerPasswordValidator <TUserDetails> >();

            return(builder);
        }