feat: add post methed for saml response (#1399)

This commit is contained in:
Yaodong Yu
2022-12-13 22:32:45 +08:00
committed by GitHub
parent e473de3162
commit e227875c2b
13 changed files with 113 additions and 2 deletions

View File

@ -125,5 +125,5 @@ export const CaptchaWidget = ({captchaType, subType, siteKey, clientSecret, onCh
}
}, [captchaType, subType, siteKey, clientSecret, clientId2, clientSecret2]);
return <div id="captcha"></div>;
return <div id="captcha" />;
};

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Casdoor Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import React, {useEffect} from "react";
export const RedirectForm = (props) => {
useEffect(() => {
document.getElementById("saml").submit();
}, []);
return (<>
<p>Redirecting, please wait.</p>
<form id="saml" method="post" action={props.redirectUrl}>
<input
type="hidden"
name="SAMLResponse"
id="samlResponse"
value={props.samlResponse}
/>
<input
type="hidden"
name="RelayState"
id="relayState"
value={props.relayState}
/>
</form>
</>
);
};
export default RedirectForm;