@@ -31,8 +31,6 @@ import (
3131
3232 "github.com/minio/console/models"
3333 "github.com/minio/console/pkg"
34- "github.com/minio/console/pkg/auth"
35- "github.com/minio/console/pkg/auth/ldap"
3634 xjwt "github.com/minio/console/pkg/auth/token"
3735 mc "github.com/minio/mc/cmd"
3836 "github.com/minio/mc/pkg/probe"
@@ -333,44 +331,6 @@ func stsCredentials(minioURL, accessKey, secretKey, location string, client *htt
333331func NewConsoleCredentials (accessKey , secretKey , location string , client * http.Client ) (* credentials.Credentials , error ) {
334332 minioURL := getMinIOServer ()
335333
336- // LDAP authentication for Console
337- if ldap .GetLDAPEnabled () {
338- creds , err := auth .GetCredentialsFromLDAP (client , minioURL , accessKey , secretKey )
339- if err != nil {
340- return nil , err
341- }
342-
343- credContext := & credentials.CredContext {
344- Client : client ,
345- }
346-
347- // We verify if LDAP credentials are correct and no error is returned
348- _ , err = creds .GetWithContext (credContext )
349-
350- if err != nil && strings .Contains (strings .ToLower (err .Error ()), "not found" ) {
351- // We try to use STS Credentials in case LDAP credentials are incorrect.
352- stsCreds , errSTS := stsCredentials (minioURL , accessKey , secretKey , location , client )
353-
354- // If there is an error with STS too, then we return the original LDAP error
355- if errSTS != nil {
356- LogError ("error in STS credentials for LDAP case: %v " , errSTS )
357-
358- // We return LDAP result
359- return creds , nil
360- }
361-
362- _ , err := stsCreds .GetWithContext (credContext )
363- // There is an error with STS credentials, We return the result of LDAP as STS is not a priority in this case.
364- if err != nil {
365- return creds , nil
366- }
367-
368- return stsCreds , nil
369- }
370-
371- return creds , nil
372- }
373-
374334 return stsCredentials (minioURL , accessKey , secretKey , location , client )
375335}
376336
0 commit comments