@@ -70,6 +70,7 @@ func NewLegacyFlagSet() *pflag.FlagSet {
7070 flagSet.AddFlagSet(legacyHeadersFlagSet())
7171 flagSet.AddFlagSet(legacyServerFlagset())
7272 flagSet.AddFlagSet(legacyProviderFlagSet())
73+ flagSet.AddFlagSet(legacyGoogleFlagSet())
7374
7475 return flagSet
7576}
@@ -481,21 +482,22 @@ type LegacyProvider struct {
481482 ClientSecret string `flag:"client-secret" cfg:"client_secret"`
482483 ClientSecretFile string `flag:"client-secret-file" cfg:"client_secret_file"`
483484
484− KeycloakGroups []string `flag:"keycloak-group" cfg:"keycloak_groups"`
485− AzureTenant string `flag:"azure-tenant" cfg:"azure_tenant"`
486− AzureGraphGroupField string `flag:"azure-graph-group-field" cfg:"azure_graph_group_field"`
487− BitbucketTeam string `flag:"bitbucket-team" cfg:"bitbucket_team"`
488− BitbucketRepository string `flag:"bitbucket-repository" cfg:"bitbucket_repository"`
489− GitHubOrg string `flag:"github-org" cfg:"github_org"`
490− GitHubTeam string `flag:"github-team" cfg:"github_team"`
491− GitHubRepo string `flag:"github-repo" cfg:"github_repo"`
492− GitHubToken string `flag:"github-token" cfg:"github_token"`
493− GitHubUsers []string `flag:"github-user" cfg:"github_users"`
494− GitLabGroup []string `flag:"gitlab-group" cfg:"gitlab_groups"`
495− GitLabProjects []string `flag:"gitlab-project" cfg:"gitlab_projects"`
496− GoogleGroups []string `flag:"google-group" cfg:"google_group"`
497− GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
498− GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
485+ KeycloakGroups []string `flag:"keycloak-group" cfg:"keycloak_groups"`
486+ AzureTenant string `flag:"azure-tenant" cfg:"azure_tenant"`
487+ AzureGraphGroupField string `flag:"azure-graph-group-field" cfg:"azure_graph_group_field"`
488+ BitbucketTeam string `flag:"bitbucket-team" cfg:"bitbucket_team"`
489+ BitbucketRepository string `flag:"bitbucket-repository" cfg:"bitbucket_repository"`
490+ GitHubOrg string `flag:"github-org" cfg:"github_org"`
491+ GitHubTeam string `flag:"github-team" cfg:"github_team"`
492+ GitHubRepo string `flag:"github-repo" cfg:"github_repo"`
493+ GitHubToken string `flag:"github-token" cfg:"github_token"`
494+ GitHubUsers []string `flag:"github-user" cfg:"github_users"`
495+ GitLabGroup []string `flag:"gitlab-group" cfg:"gitlab_groups"`
496+ GitLabProjects []string `flag:"gitlab-project" cfg:"gitlab_projects"`
497+ GoogleGroups []string `flag:"google-group" cfg:"google_group"`
498+ GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
499+ GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
500+ GoogleUseApplicationDefaultCredentials bool `flag:"google-use-application-default-credentials" cfg:"google_use_application_default_credentials"`
499501
500502 // These options allow for other providers besides Google, with
501503 // potential overrides.
@@ -549,9 +551,6 @@ func legacyProviderFlagSet() *pflag.FlagSet {
549551 flagSet.StringSlice("github-user", []string{}, "allow users with these usernames to login even if they do not belong to the specified org and team or collaborators (may be given multiple times)")
550552 flagSet.StringSlice("gitlab-group", []string{}, "restrict logins to members of this group (may be given multiple times)")
551553 flagSet.StringSlice("gitlab-project", []string{}, "restrict logins to members of this project (may be given multiple times) (eg `group/project=accesslevel`). Access level should be a value matching Gitlab access levels (see https://docs.gitlab.com/ee/api/members.html#valid-access-levels), defaulted to 20 if absent")
552− flagSet.StringSlice("google-group", []string{}, "restrict logins to members of this google group (may be given multiple times).")
553− flagSet.String("google-admin-email", "", "the google admin to impersonate for api calls")
554− flagSet.String("google-service-account-json", "", "the path to the service account json credentials")
555554 flagSet.String("client-id", "", "the OAuth Client ID: ie: \"123456.apps.googleusercontent.com\"")
556555 flagSet.String("client-secret", "", "the OAuth Client Secret")
557556 flagSet.String("client-secret-file", "", "the file with OAuth Client Secret")
@@ -592,6 +591,17 @@ func legacyProviderFlagSet() *pflag.FlagSet {
592591 return flagSet
593592}
594593
594+func legacyGoogleFlagSet() *pflag.FlagSet {
595+ flagSet := pflag.NewFlagSet("google", pflag.ExitOnError)
596+
597+ flagSet.StringSlice("google-group", []string{}, "restrict logins to members of this google group (may be given multiple times).")
598+ flagSet.String("google-admin-email", "", "the google admin to impersonate for api calls")
599+ flagSet.String("google-service-account-json", "", "the path to the service account json credentials")
600+ flagSet.String("google-use-application-default-credentials", "", "use application default credentials instead of service account json (i.e. GKE Workload Identity)")
601+
602+ return flagSet
603+}
604+
595605func (l LegacyServer) convert() (Server, Server) {
596606 appServer := Server{
597607 BindAddress: l.HTTPAddress,
@@ -718,9 +728,10 @@ func (l *LegacyProvider) convert() (Providers, error) {
718728 }
719729 case "google":
720730 provider.GoogleConfig = GoogleOptions{
721− Groups: l.GoogleGroups,
722− AdminEmail: l.GoogleAdminEmail,
723− ServiceAccountJSON: l.GoogleServiceAccountJSON,
731+ Groups: l.GoogleGroups,
732+ AdminEmail: l.GoogleAdminEmail,
733+ ServiceAccountJSON: l.GoogleServiceAccountJSON,
734+ UseApplicationDefaultCredentials: l.GoogleUseApplicationDefaultCredentials,
724735 }
725736 }
726737