コード例 #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
ファイル: DefaultLogoutService.cs プロジェクト: alexis-/BFF
 /// <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
ファイル: DefaultUserService.cs プロジェクト: alexis-/BFF
 /// <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;
 }