Skip to content

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

@lstoll

Description

@lstoll

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions