public Saml20MiddlewareTests() { var certificate = new X509Certificate2(Path.Combine(Directory.GetCurrentDirectory(), "federationgateway.pfx"), "identityserver"); _keyManager = new DefaultKeyMaterialService(certificate); _relyingPartyStore = new InMemoryRelyingPartyStore(new List <RelyingParty> { new RelyingParty { Realm = "urn:test", ReplyUrl = "https://localhost", LogoutUrl = "https://localhost" } }); _profileManager = new DefaultProfileManager(); _logger = new NullLogger <Saml20Middleware>(); var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", false) .Build(); _options = Options.Create(configuration.GetSection("identityServer") .Get <FederationGatewayOptions>()); }
public RelyingPartyProvider(IOptionsMonitor <WsTrustOptions> monitor, ILogger <RelyingPartyProvider> logger, IRelyingPartyStore store = null) { Options = monitor.CurrentValue; _optionsChangeToken = monitor.OnChange((options, _) => Options = options); _logger = logger; _store = store; }
public WsFedMiddleware(RequestDelegate next, ILogger <WsFedMiddleware> logger, IRelyingPartyStore relyingPartyStore, SignInResponseGenerator responseGenerator, WsTrustSerializer serializer, IOptions <FederationGatewayOptions> options) { if (next == null) { throw new ArgumentNullException(nameof(next)); } if (relyingPartyStore == null) { throw new ArgumentNullException(nameof(relyingPartyStore)); } if (responseGenerator == null) { throw new ArgumentNullException(nameof(responseGenerator)); } if (serializer == null) { throw new ArgumentNullException(nameof(serializer)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _next = next; _logger = logger; _relyingPartyStore = relyingPartyStore; _responseGenerator = responseGenerator; _serializer = serializer; _options = options.Value; }
/// <summary> /// Initializes a new instance of the <see cref="CachingRelyingPartyStore{T}"/> class. /// </summary> /// <param name="options">The options.</param> /// <param name="inner">The inner.</param> /// <param name="cache">The cache.</param> /// <param name="logger">The logger.</param> public CachingRelyingPartyStore(IdentityServerOptions options, T inner, ICache <RelyingParty> cache, ILogger <CachingRelyingPartyStore <T> > logger) { _options = options; _inner = inner; _cache = cache; _logger = logger; }
public SignInResponseGenerator(ILogger <SignInResponseGenerator> logger, IRelyingPartyStore relyingPartyStore, IProfileManager profileManager, IKeyMaterialService keyService, IOptions <FederationGatewayOptions> options ) { if (relyingPartyStore == null) { throw new ArgumentNullException(nameof(relyingPartyStore)); } if (profileManager == null) { throw new ArgumentNullException(nameof(profileManager)); } if (keyService == null) { throw new ArgumentNullException(nameof(keyService)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _logger = logger; _relyingPartyStore = relyingPartyStore; _profileManager = profileManager; _keyService = keyService; _options = options.Value; }
public SignInValidator( WsFederationOptions options, IClientStore clients, IRelyingPartyStore relyingParties, ISystemClock clock, ILogger <SignInValidator> logger) { _options = options; _clients = clients; _relyingParties = relyingParties; _clock = clock; _logger = logger; }
public static IServiceCollection AddFederationGateway(this IServiceCollection services, IProfileManager profileManager, IRelyingPartyStore relyingPartyStore, X509Certificate2 issuerCert, Action <FederationGatewayOptions> options) { services.AddSingleton <WsFederationMetadataSerializer>(); services.AddSingleton <WsTrustSerializer>(); services.AddSingleton <SamlResponseSerializer>(); services.AddSingleton <IKeyMaterialService>(new DefaultKeyMaterialService(issuerCert)); services.AddSingleton <IProfileManager>(profileManager); services.AddSingleton <IRelyingPartyStore>(relyingPartyStore); services.AddSingleton <SignInResponseGenerator>(); services.Configure <FederationGatewayOptions>(options); return(services); }
public SignInValidator(WsFederationOptions options, IClientStore clients, IRelyingPartyStore relyingParties) { _options = options; _clients = clients; _relyingParties = relyingParties; }
/// <summary> /// Initializes a new instance of the <see cref="SignInValidator"/> class. /// </summary> /// <param name="clients">The clients.</param> /// <param name="relyingParties">The relying parties.</param> public SignInValidator(IClientStore clients, IRelyingPartyStore relyingParties) { _clients = clients ?? throw new ArgumentNullException(nameof(clients)); _relyingParties = relyingParties ?? throw new ArgumentNullException(nameof(relyingParties)); }
public RelyingPartyController(ILogger <RelyingPartyController> logger, IRelyingPartyStore relyingPartyStore) { _logger = logger; _relyingPartyStore = relyingPartyStore; }