Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

middleware: Failure on init causes panic until process restart #51

Open
lstoll opened this issue Feb 9, 2023 · 0 comments
Open

middleware: Failure on init causes panic until process restart #51

lstoll opened this issue Feb 9, 2023 · 0 comments

Comments

@lstoll
Copy link

lstoll commented Feb 9, 2023

We use a once block to set up the OIDC client in the middleware:

var initErr error
h.oidcClientInit.Do(func() {
h.oidcClient, initErr = oidc.DiscoverClient(ctx, h.Issuer, h.ClientID, h.ClientSecret, h.RedirectURL)
})
if initErr != nil {
return nil, initErr
}

If the discovery fails, this will return an error and never attempt to initialise the client again. We should always try and initialise until we have a functioning client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant