fix unassume in cas-curl
This commit is contained in:
parent
7dea3607f1
commit
802cc3a622
@ -13,10 +13,16 @@ if [ "$1" == "--trace" ]; then
|
|||||||
}
|
}
|
||||||
function doCurl() {
|
function doCurl() {
|
||||||
set -x
|
set -x
|
||||||
|
if [ -z "$HSADMINNG_CAS_ASSUME" ]; then
|
||||||
|
curl --fail-with-body \
|
||||||
|
--header "Authorization: $HSADMINNG_CAS_TICKET" \
|
||||||
|
"$@"
|
||||||
|
else
|
||||||
curl --fail-with-body \
|
curl --fail-with-body \
|
||||||
--header "Authorization: $HSADMINNG_CAS_TICKET" \
|
--header "Authorization: $HSADMINNG_CAS_TICKET" \
|
||||||
--header "assumed-roles: $HSADMINNG_CAS_ASSUME" \
|
--header "assumed-roles: $HSADMINNG_CAS_ASSUME" \
|
||||||
"$@"
|
"$@"
|
||||||
|
fi
|
||||||
set +x
|
set +x
|
||||||
}
|
}
|
||||||
shift
|
shift
|
||||||
|
@ -45,13 +45,13 @@ public class CasAuthenticator implements Authenticator {
|
|||||||
private String casValidation(final HttpServletRequest httpRequest)
|
private String casValidation(final HttpServletRequest httpRequest)
|
||||||
throws SAXException, IOException, ParserConfigurationException {
|
throws SAXException, IOException, ParserConfigurationException {
|
||||||
|
|
||||||
System.err.println("CasAuthenticator.casValidation using CAS-server: " + casServerUrl);
|
|
||||||
|
|
||||||
final var ticket = httpRequest.getHeader("Authorization");
|
final var ticket = httpRequest.getHeader("Authorization");
|
||||||
final var url = casServerUrl + "/p3/serviceValidate" +
|
final var url = casServerUrl + "/p3/serviceValidate" +
|
||||||
"?service=" + serviceUrl +
|
"?service=" + serviceUrl +
|
||||||
"&ticket=" + ticket;
|
"&ticket=" + ticket;
|
||||||
|
|
||||||
|
System.err.println("CasAuthenticator.casValidation using URL: " + url);
|
||||||
|
|
||||||
final var response = restTemplate.getForObject(url, String.class);
|
final var response = restTemplate.getForObject(url, String.class);
|
||||||
|
|
||||||
final var doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
final var doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user