Changed IDP login support in console (#2695)

- Allowed to use External IDP + Built-in IDP at the same time
- Added IDP type to IDP listing
- Added IDP name when no display name is configured
- Changed STS login link into new menu
- Cleanup of Operator login strategies

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2023-03-07 16:10:21 -06:00
committed by GitHub
parent 1953a98968
commit 1fc9a40273
9 changed files with 129 additions and 279 deletions

View File

@@ -7592,6 +7592,9 @@ func init() {
},
"redirect": {
"type": "string"
},
"serviceType": {
"type": "string"
}
}
},
@@ -16573,6 +16576,9 @@ func init() {
},
"redirect": {
"type": "string"
},
"serviceType": {
"type": "string"
}
}
},

View File

@@ -20,7 +20,9 @@ import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
@@ -186,15 +188,25 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams, openIDProviders o
Client: oauth2Client,
}
displayName := "Login with SSO"
displayName := fmt.Sprintf("Login with SSO (%s)", name)
serviceType := ""
if provider.DisplayName != "" {
displayName = provider.DisplayName
}
if provider.RoleArn != "" {
splitRoleArn := strings.Split(provider.RoleArn, ":")
if len(splitRoleArn) > 2 {
serviceType = splitRoleArn[2]
}
}
redirectRule := models.RedirectRule{
Redirect: identityProvider.GenerateLoginURL(),
DisplayName: displayName,
ServiceType: serviceType,
}
redirectRules = append(redirectRules, &redirectRule)