diff --git a/object/saml_idp.go b/object/saml_idp.go index 8da04574..c21b6372 100644 --- a/object/saml_idp.go +++ b/object/saml_idp.go @@ -338,6 +338,9 @@ func GetSamlResponse(application *Application, user *User, samlRequest string, h } else if authnRequest.AssertionConsumerServiceURL == "" { return "", "", "", fmt.Errorf("err: SAML request don't has attribute 'AssertionConsumerServiceURL' in ") } + if authnRequest.ProtocolBinding == "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" { + method = "POST" + } _, originBackend := getOriginFromHost(host) diff --git a/web/src/auth/AuthCallback.js b/web/src/auth/AuthCallback.js index 13bfdf55..da88c46c 100644 --- a/web/src/auth/AuthCallback.js +++ b/web/src/auth/AuthCallback.js @@ -204,7 +204,7 @@ class AuthCallback extends React.Component { } const SAMLResponse = res.data; const redirectUri = res.data2.redirectUrl; - Setting.goToLink(`${redirectUri}?SAMLResponse=${encodeURIComponent(SAMLResponse)}&RelayState=${oAuthParams.relayState}`); + Setting.goToLink(`${redirectUri}${redirectUri.includes("?") ? "&" : "?"}SAMLResponse=${encodeURIComponent(SAMLResponse)}&RelayState=${oAuthParams.relayState}`); } } } else { diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index 0740dedd..01fedcda 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -505,7 +505,7 @@ class LoginPage extends React.Component { } else { const SAMLResponse = res.data; const redirectUri = res.data2.redirectUrl; - Setting.goToLink(`${redirectUri}?SAMLResponse=${encodeURIComponent(SAMLResponse)}&RelayState=${oAuthParams.relayState}`); + Setting.goToLink(`${redirectUri}${redirectUri.includes("?") ? "&" : "?"}SAMLResponse=${encodeURIComponent(SAMLResponse)}&RelayState=${oAuthParams.relayState}`); } } };