Improve SAML IdP name handling
This commit is contained in:
@@ -314,7 +314,7 @@ func (h *AuthHandlers) enrichTmplData(req *request.AuthReq) interface{} {
|
||||
var pp = make([]provider, 0, len(dSettings.Providers))
|
||||
|
||||
if h.Settings.Saml.Enabled {
|
||||
pp = append(pp, provider(saml.TemplateProvider(h.Settings.Saml.IDP.URL, h.Settings.Saml.IDP.Name)))
|
||||
pp = append(pp, provider(saml.TemplateProvider(h.Settings.Saml.IDP.URL, h.Settings.Saml.Name)))
|
||||
}
|
||||
|
||||
for _, p := range dSettings.Providers {
|
||||
|
||||
+9
-9
@@ -40,15 +40,15 @@ func TemplateProvider(url, name string) templateProvider {
|
||||
// UpdateSettings applies the app settings to the
|
||||
// auth specific settings
|
||||
func UpdateSettings(source *types.AppSettings, dest *settings.Settings) {
|
||||
cas := source.Auth
|
||||
saml := source.Auth.External.Saml
|
||||
|
||||
dest.Saml.Enabled = cas.External.Saml.Enabled
|
||||
dest.Saml.Cert = cas.External.Saml.Cert
|
||||
dest.Saml.Key = cas.External.Saml.Key
|
||||
dest.Saml.Enabled = saml.Enabled
|
||||
dest.Saml.Name = saml.Name
|
||||
dest.Saml.Cert = saml.Cert
|
||||
dest.Saml.Key = saml.Key
|
||||
|
||||
dest.Saml.IDP.URL = cas.External.Saml.IDP.URL
|
||||
dest.Saml.IDP.Name = cas.External.Saml.IDP.Name
|
||||
dest.Saml.IDP.IdentName = cas.External.Saml.IDP.IdentName
|
||||
dest.Saml.IDP.IdentHandle = cas.External.Saml.IDP.IdentHandle
|
||||
dest.Saml.IDP.IdentIdentifier = cas.External.Saml.IDP.IdentIdentifier
|
||||
dest.Saml.IDP.URL = saml.IDP.URL
|
||||
dest.Saml.IDP.IdentName = saml.IDP.IdentName
|
||||
dest.Saml.IDP.IdentHandle = saml.IDP.IdentHandle
|
||||
dest.Saml.IDP.IdentIdentifier = saml.IDP.IdentIdentifier
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ type (
|
||||
SAML struct {
|
||||
Enabled bool
|
||||
|
||||
// IdP name used on a login form
|
||||
Name string
|
||||
|
||||
// SAML certificate
|
||||
Cert string
|
||||
|
||||
@@ -25,8 +28,7 @@ type (
|
||||
|
||||
// Identity provider hostname
|
||||
IDP struct {
|
||||
URL string
|
||||
Name string
|
||||
URL string
|
||||
|
||||
// identifier payload from idp
|
||||
IdentName string
|
||||
|
||||
@@ -74,6 +74,9 @@ type (
|
||||
Saml struct {
|
||||
Enabled bool
|
||||
|
||||
// IdP name used on the login form
|
||||
Name string `kv:"name"`
|
||||
|
||||
// SAML certificate
|
||||
Cert string `kv:"cert"`
|
||||
|
||||
@@ -82,8 +85,7 @@ type (
|
||||
|
||||
// Identity provider settings
|
||||
IDP struct {
|
||||
URL string `kv:"url"`
|
||||
Name string
|
||||
URL string `kv:"url"`
|
||||
|
||||
// identifier payload from idp
|
||||
IdentName string `kv:"ident-name"`
|
||||
|
||||
Reference in New Issue
Block a user