Add application.EnableSamlC14n10

This commit is contained in:
Yang Luo
2023-10-20 22:37:23 +08:00
parent b68e291f37
commit 22b57fdd23
3 changed files with 18 additions and 2 deletions

View File

@ -57,6 +57,7 @@ type Application struct {
EnableAutoSignin bool `json:"enableAutoSignin"`
EnableCodeSignin bool `json:"enableCodeSignin"`
EnableSamlCompress bool `json:"enableSamlCompress"`
EnableSamlC14n10 bool `json:"enableSamlC14n10"`
EnableWebAuthn bool `json:"enableWebAuthn"`
EnableLinkWithEmail bool `json:"enableLinkWithEmail"`
OrgChoiceMode string `json:"orgChoiceMode"`

View File

@ -324,6 +324,11 @@ func GetSamlResponse(application *Application, user *User, samlRequest string, h
}
ctx := dsig.NewDefaultSigningContext(randomKeyStore)
ctx.Hash = crypto.SHA1
if application.EnableSamlC14n10 {
ctx.Canonicalizer = dsig.MakeC14N10RecCanonicalizer()
}
//signedXML, err := ctx.SignEnvelopedLimix(samlResponse)
//if err != nil {
// return "", "", fmt.Errorf("err: %s", err.Error())