Skip to content

Serious problems with external service auth provider config are never shown

Created by: mrnugget

See this comment for full context: https://github.com/sourcegraph/sourcegraph/issues/6039#issuecomment-542705269

When you configure an external service, let's say Gitlab, with an invalid authorization config, like this:

{
  "url": "https://gitlab.fooooobar.org",
  "token": "TOOOOOKEN",
  "projectQuery": [
    "?"
  ],
  "authorization": {
    "identityProvider": {
      "type": "external",
      "authProviderID": "testingtestinginvalid",
      "authProviderType": "openidconnect",
      "gitlabProvider": "saml"
    },
    "ttl": "3h"
  }
}

then this will validation and produce a seriousProblem: https://github.com/sourcegraph/sourcegraph/blob/b1f43ea108b0e93c9df3f75b7f756aaee95c53a1/enterprise/cmd/frontend/internal/authz/init.go#L43-L50

The problem is that these seriousProblems are never displayed or logged in the UI:

https://github.com/sourcegraph/sourcegraph/blob/b1f43ea108b0e93c9df3f75b7f756aaee95c53a1/enterprise/cmd/frontend/internal/authz/init.go#L35-L41

But they do cause allowAccessByDefault to be set to false, which causes the builtin auth provider to not work anymore.