mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 09:13:50 +08:00
feat: support third-party application to login with SAML rather than only Casdoor itself (#350)
Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
@ -186,8 +186,15 @@ class LoginPage extends React.Component {
|
||||
}
|
||||
|
||||
getSamlUrl(providerId) {
|
||||
const params = new URLSearchParams(this.props.location.search);
|
||||
let clientId = params.get("client_id")
|
||||
let application = params.get("state");
|
||||
let realRedirectUri = params.get("redirect_uri");
|
||||
let redirectUri = `${window.location.origin}/callback/saml`
|
||||
let providerName = providerId.split('/')[1];
|
||||
AuthBackend.getSamlLogin(providerId).then((res) => {
|
||||
window.location.href = res.data
|
||||
const replyState = `${clientId}&${application}&${providerName}&${realRedirectUri}&${redirectUri}`;
|
||||
window.location.href = `${res.data}&RelayState=${btoa(replyState)}`;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user