/// <summary> /// Initialises a new instance of the <see cref="AuthenticationController"/> class with the given dependencies. /// </summary> /// <param name="logger">A generic logger</param> /// <param name="generalSettings">Configuration for the authentication scope.</param> /// <param name="jwtHandler">the handler for jwt cookie authentication</param> /// <param name="signingKeysRetriever">The class to use to obtain the signing keys.</param> /// <param name="organisationRepository">the repository object that holds valid organisations</param> public AuthenticationController( ILogger <AuthenticationController> logger, IOptions <GeneralSettings> generalSettings, JwtCookieHandler jwtHandler, ISigningKeysRetriever signingKeysRetriever, IOrganisationRepository organisationRepository) { this.logger = logger; this.generalSettings = generalSettings.Value; this.jwtHandler = jwtHandler; this.signingKeysRetriever = signingKeysRetriever; this.organisationRepository = organisationRepository; }
/// <summary> /// Initialises a new instance of the <see cref="AuthenticationController"/> class with the given dependencies. /// </summary> /// <param name="logger">A generic logger</param> /// <param name="generalSettings">Configuration for the authentication scope.</param> /// <param name="cookieDecryptionService">A service that can decrypt a .ASPXAUTH cookie.</param> /// <param name="organisationRepository">the repository object that holds valid organisations</param> /// <param name="certificateProvider">Service that can obtain a list of certificates that can be used to generate JSON Web Tokens.</param> /// <param name="signingKeysRetriever">The class to use to obtain the signing keys.</param> public AuthenticationController( ILogger <AuthenticationController> logger, IOptions <GeneralSettings> generalSettings, ISigningKeysRetriever signingKeysRetriever, IJwtSigningCertificateProvider certificateProvider, ISblCookieDecryptionService cookieDecryptionService, IOrganisationRepository organisationRepository) { _logger = logger; _generalSettings = generalSettings.Value; _signingKeysRetriever = signingKeysRetriever; _certificateProvider = certificateProvider; _cookieDecryptionService = cookieDecryptionService; _organisationRepository = organisationRepository; }
/// <summary> /// Initialises a new instance of the <see cref="AuthenticationController"/> class with the given dependencies. /// </summary> /// <param name="logger">A generic logger</param> /// <param name="generalSettings">Configuration for the authentication scope.</param> /// <param name="cookieDecryptionService">A service that can decrypt a .ASPXAUTH cookie.</param> /// <param name="organisationRepository">the repository object that holds valid organisations</param> /// <param name="certificateProvider">Service that can obtain a list of certificates that can be used to generate JSON Web Tokens.</param> /// <param name="userProfileService">Service that can retrieve user profiles.</param> /// <param name="signingKeysRetriever">The class to use to obtain the signing keys.</param> public AuthenticationController( ILogger <AuthenticationController> logger, IOptions <GeneralSettings> generalSettings, ISigningKeysRetriever signingKeysRetriever, IJwtSigningCertificateProvider certificateProvider, ISblCookieDecryptionService cookieDecryptionService, IUserProfileService userProfileService, IOrganisationRepository organisationRepository) { _logger = logger; _generalSettings = generalSettings.Value; _signingKeysRetriever = signingKeysRetriever; _certificateProvider = certificateProvider; _cookieDecryptionService = cookieDecryptionService; _organisationRepository = organisationRepository; _userProfileService = userProfileService; _validator = new JwtSecurityTokenHandler(); }