Use app.conf value in getOriginFromHost()

This commit is contained in:
Gucheng Wang
2022-09-03 15:12:26 +08:00
parent af9ae7dbb7
commit 4536fd0636
6 changed files with 13 additions and 29 deletions

View File

@ -29,7 +29,6 @@ import (
"github.com/RobotsAndPencils/go-saml"
"github.com/beevik/etree"
"github.com/casdoor/casdoor/conf"
"github.com/golang-jwt/jwt/v4"
dsig "github.com/russellhaering/goxmldsig"
uuid "github.com/satori/go.uuid"
@ -176,16 +175,12 @@ type Attribute struct {
}
func GetSamlMeta(application *Application, host string) (*IdpEntityDescriptor, error) {
//_, originBackend := getOriginFromHost(host)
cert := getCertByApplication(application)
block, _ := pem.Decode([]byte(cert.Certificate))
certificate := base64.StdEncoding.EncodeToString(block.Bytes)
origin := conf.GetConfigString("origin")
originFrontend, originBackend := getOriginFromHost(host)
if origin != "" {
originBackend = origin
}
d := IdpEntityDescriptor{
XMLName: xml.Name{
Local: "md:EntityDescriptor",