mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 03:33:49 +08:00
feat: fix bug that login by saml provider can not find application (#1676)
This commit is contained in:
@ -101,12 +101,13 @@ function getSigninButton(type) {
|
||||
|
||||
function getSamlUrl(provider, location) {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const clientId = params.get("client_id");
|
||||
const application = params.get("state");
|
||||
const clientId = params.get("client_id") ?? "";
|
||||
const state = params.get("state");
|
||||
const realRedirectUri = params.get("redirect_uri");
|
||||
const redirectUri = `${window.location.origin}/callback/saml`;
|
||||
const providerName = provider.name;
|
||||
const relayState = `${clientId}&${application}&${providerName}&${realRedirectUri}&${redirectUri}`;
|
||||
|
||||
const relayState = `${clientId}&${state}&${providerName}&${realRedirectUri}&${redirectUri}`;
|
||||
AuthBackend.getSamlLogin(`${provider.owner}/${providerName}`, btoa(relayState)).then((res) => {
|
||||
if (res.data2 === "POST") {
|
||||
document.write(res.data);
|
||||
|
Reference in New Issue
Block a user