Skip to content

Can't Signout -- OAuth as only Auth

Created by: DaedalusG

  • Sourcegraph version:
  • Platform information:

Steps to reproduce:

  1. Create a Sourcegraph instance and configure OAuth as the only source of login
	"auth.providers": [
		// {
		// 	"type": "builtin",
		// 	"allowSignup": false
		// },
		{
			"type": "github",
			"displayName": "GitHub",
			"clientID": "REDACTED",
			"clientSecret": "REDACTED",
			"allowSignup": false, // Set to true to enable anyone with a GitHub account to sign up without invitation
			"allowOrgs": [ "sourcegraph" ] // Restrict logins to members of these orgs.
		},
          ]
  1. Sign out and attempt to sign back in

Expected behavior:

You should be able to signout

Actual behavior:

You'll very briefly be signed out -- but you'll immediately be signed back in

This is because Sourcegraph will automatically attempt to use the only available sign in method id only one sign on option is available. If OAuth is the only available option a OAuth signing will immediately be attempted.

Just noting this is documented in our codebase comments, so its not a bug per say