/// <summary> /// Ctor /// </summary> /// <param name="options"></param> /// <param name="ticketStore"></param> /// <param name="sessionStore"></param> /// <param name="tokenEndpoint"></param> /// <param name="logger"></param> public SessionRevocationService(BffOptions options, IServerTicketStore ticketStore, IUserSessionStore sessionStore, ITokenEndpointService tokenEndpoint, ILogger <SessionRevocationService> logger) { _options = options; _ticketStore = ticketStore; _sessionStore = sessionStore; _tokenEndpoint = tokenEndpoint; _logger = logger; }
public static void CheckForBffMiddleware(this HttpContext context, BffOptions options) { if (options.EnforceBffMiddleware) { var found = context.Items.TryGetValue(Constants.BffMiddlewareMarker, out _); if (!found) { throw new InvalidOperationException( "The BFF middleware is missing in the pipeline. Add 'app.UseBff' after 'app.UseRouting' but before 'app.UseAuthorization'"); } } }
/// <summary> /// Ctor /// </summary> /// <param name="options"></param> /// <param name="authenticationSchemeProvider"></param> public DefaultLogoutService(BffOptions options, IAuthenticationSchemeProvider authenticationSchemeProvider) { _options = options; _schemes = authenticationSchemeProvider; }
/// <summary> /// ctor /// </summary> /// <param name="bffOptions"></param> /// <param name="authOptions"></param> /// <param name="logger"></param> public PostConfigureApplicationCookieRevokeRefreshToken(BffOptions bffOptions, IOptions <AuthenticationOptions> authOptions, ILogger <PostConfigureApplicationCookieRevokeRefreshToken> logger) { _options = bffOptions; _scheme = authOptions.Value.DefaultAuthenticateScheme ?? authOptions.Value.DefaultScheme; _logger = logger; }
public static bool CheckAntiForgeryHeader(this HttpContext context, BffOptions options) { var antiForgeryHeader = context.Request.Headers[options.AntiForgeryHeaderName].FirstOrDefault(); return(antiForgeryHeader != null && antiForgeryHeader == options.AntiForgeryHeaderValue); }
/// <summary> /// ctor /// </summary> /// <param name="bffOptions"></param> /// <param name="authOptions"></param> /// <param name="logger"></param> public PostConfigureSlidingExpirationCheck(BffOptions bffOptions, IOptions <AuthenticationOptions> authOptions, ILogger <PostConfigureSlidingExpirationCheck> logger) { _options = bffOptions; _scheme = authOptions.Value.DefaultAuthenticateScheme ?? authOptions.Value.DefaultScheme; _logger = logger; }
/// <summary> /// ctor /// </summary> /// <param name="options"></param> public DefaultHttpTransformerFactory(BffOptions options) { Options = options; }
/// <summary> /// Ctor /// </summary> /// <param name="options"></param> /// <param name="loggerFactory"></param> public DefaultUserService(BffOptions options, ILoggerFactory loggerFactory) { _options = options; _logger = loggerFactory.CreateLogger("Duende.Bff.BffApiEndpoint"); }
/// <summary> /// ctor /// </summary> /// <param name="httpContextAccessor"></param> public TicketStoreShim(IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; _options = _httpContextAccessor.HttpContext.RequestServices.GetRequiredService <BffOptions>(); }
/// <summary> /// Ctor /// </summary> /// <param name="options"></param> /// <param name="loggerFactory"></param> public DefaultUserService(BffOptions options, ILoggerFactory loggerFactory) { Options = options; Logger = loggerFactory.CreateLogger(LogCategories.ManagementEndpoints); }
/// <summary> /// ctor /// </summary> /// <param name="bffOptions"></param> /// <param name="authOptions"></param> /// <param name="logger"></param> public PostConfigureApplicationValidatePrincipal(BffOptions bffOptions, IOptions <AuthenticationOptions> authOptions, ILogger <PostConfigureApplicationValidatePrincipal> logger) { _options = bffOptions; _scheme = authOptions.Value.DefaultAuthenticateScheme ?? authOptions.Value.DefaultScheme; _logger = logger; }
/// <summary> /// ctor /// </summary> /// <param name="options"></param> public DefaultLoginService(BffOptions options) { _options = options; }