This commit is contained in:
A.Unger
2020-11-30 17:19:03 +01:00
parent d856d5470e
commit 5cb359d877
6 changed files with 78 additions and 9 deletions

View File

@@ -268,8 +268,8 @@ func loadMiddlewares(ctx context.Context, l log.Logger, cfg *config.Config) alic
return alice.New(
middleware.HTTPSRedirect,
middleware.OIDCAuth(
middleware.Logger(l),
middleware.Authentication(
// OIDC Options
middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) {
// Initialize a provider by specifying the issuer URL.
// it will fetch the keys from the issuer using the .well-known
@@ -280,13 +280,12 @@ func loadMiddlewares(ctx context.Context, l log.Logger, cfg *config.Config) alic
)
}),
middleware.HTTPClient(oidcHTTPClient),
middleware.OIDCIss(cfg.OIDC.Issuer),
middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size),
middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)),
),
middleware.BasicAuth(
// basic Options
middleware.Logger(l),
middleware.EnableBasicAuth(cfg.EnableBasicAuth),
middleware.EnableBasicAuth(true),
middleware.AccountsClient(accountsClient),
middleware.OIDCIss(cfg.OIDC.Issuer),
),