Пример #1
0
 /// <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;
 }
Пример #2
0
 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'");
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="options"></param>
 /// <param name="authenticationSchemeProvider"></param>
 public DefaultLogoutService(BffOptions options, IAuthenticationSchemeProvider authenticationSchemeProvider)
 {
     _options = options;
     _schemes = authenticationSchemeProvider;
 }
Пример #4
0
 /// <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;
 }
Пример #5
0
        public static bool CheckAntiForgeryHeader(this HttpContext context, BffOptions options)
        {
            var antiForgeryHeader = context.Request.Headers[options.AntiForgeryHeaderName].FirstOrDefault();

            return(antiForgeryHeader != null && antiForgeryHeader == options.AntiForgeryHeaderValue);
        }
Пример #6
0
 /// <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;
 }
Пример #7
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="options"></param>
 public DefaultHttpTransformerFactory(BffOptions options)
 {
     Options = options;
 }
Пример #8
0
 /// <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");
 }
Пример #9
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="httpContextAccessor"></param>
 public TicketStoreShim(IHttpContextAccessor httpContextAccessor)
 {
     _httpContextAccessor = httpContextAccessor;
     _options             = _httpContextAccessor.HttpContext.RequestServices.GetRequiredService <BffOptions>();
 }
Пример #10
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="options"></param>
 /// <param name="loggerFactory"></param>
 public DefaultUserService(BffOptions options, ILoggerFactory loggerFactory)
 {
     Options = options;
     Logger  = loggerFactory.CreateLogger(LogCategories.ManagementEndpoints);
 }
Пример #11
0
 /// <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;
 }
Пример #12
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="options"></param>
 public DefaultLoginService(BffOptions options)
 {
     _options = options;
 }