@@ -75,10 +75,19 @@ func (p *AuthSourceProvider) IconHTML(size int) template.HTML {
7575// value is used to store display data 
7676var  gothProviders  =  map [string ]GothProvider {}
7777
78- var  azureProviders  =  map [string ]bool {
79- 	"azuread" :         true ,
80- 	"microsoftonline" : true ,
81- 	"azureadv2" :       true ,
78+ var  azureProviders  =  []string {
79+ 	"azuread" ,
80+ 	"microsoftonline" ,
81+ 	"azureadv2" ,
82+ }
83+ 
84+ func  isAzureProvider (providerName  string ) bool  {
85+ 	for  _ , azureProvider  :=  range  azureProviders  {
86+ 		if  providerName  ==  azureProvider  {
87+ 			return  true 
88+ 		}
89+ 	}
90+ 	return  false 
8291}
8392
8493// RegisterGothProvider registers a GothProvider 
@@ -100,7 +109,7 @@ func hasExistingAzureADAuthSources(ctx context.Context) bool {
100109
101110	for  _ , source  :=  range  authSources  {
102111		if  oauth2Cfg , ok  :=  source .Cfg .(* Source ); ok  {
103- 			if  azureProviders [ oauth2Cfg .Provider ]  {
112+ 			if  isAzureProvider ( oauth2Cfg .Provider )  {
104113				return  true 
105114			}
106115		}
@@ -123,7 +132,7 @@ func GetSupportedOAuth2ProvidersWithContext(ctx context.Context) []Provider {
123132	hasExistingAzure  :=  hasExistingAzureADAuthSources (ctx )
124133
125134	for  _ , provider  :=  range  gothProviders  {
126- 		if  azureProviders [ provider .Name ()]  &&  ! hasExistingAzure  {
135+ 		if  isAzureProvider ( provider .Name ())  &&  ! hasExistingAzure  {
127136			continue 
128137		}
129138		providers  =  append (providers , provider )
0 commit comments