Auth: add name parameter to auth.saml (#39883)
* add name parameter to auth.saml * Create constant to store default SAML name
This commit is contained in:
@@ -97,6 +97,7 @@ func (hs *HTTPServer) LoginView(c *models.ReqContext) {
|
||||
|
||||
viewData.Settings["oauth"] = enabledOAuths
|
||||
viewData.Settings["samlEnabled"] = hs.samlEnabled()
|
||||
viewData.Settings["samlName"] = hs.samlName()
|
||||
|
||||
if loginError, ok := hs.tryGetEncryptedCookie(c, loginErrorCookieName); ok {
|
||||
// this cookie is only set whenever an OAuth login fails
|
||||
@@ -346,6 +347,10 @@ func (hs *HTTPServer) samlEnabled() bool {
|
||||
return hs.SettingsProvider.KeyValue("auth.saml", "enabled").MustBool(false) && hs.License.HasValidLicense()
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) samlName() string {
|
||||
return hs.SettingsProvider.KeyValue("auth.saml", "name").MustString("SAML")
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) samlSingleLogoutEnabled() bool {
|
||||
return hs.SettingsProvider.KeyValue("auth.saml", "single_logout").MustBool(false) && hs.samlEnabled()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user