optional to users
This commit is contained in:
parent
15a4c526b4
commit
917a4e3535
@ -20,7 +20,7 @@ public class CasValidator {
|
|||||||
this.ticket = ticket;
|
this.ticket = ticket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String validate() throws Exception, CasValidationExcepiton{
|
public String validate() throws Exception, CasValidationExcepiton {
|
||||||
HttpGet request = new HttpGet(CasValidator.CAS_URL + "/validate?service="
|
HttpGet request = new HttpGet(CasValidator.CAS_URL + "/validate?service="
|
||||||
+ URLEncoder.encode(this.service, "UTF-8") + "&ticket=" + URLEncoder.encode(this.ticket, "UTF-8"));
|
+ URLEncoder.encode(this.service, "UTF-8") + "&ticket=" + URLEncoder.encode(this.ticket, "UTF-8"));
|
||||||
try (CloseableHttpResponse response = httpClient.execute(request)) {
|
try (CloseableHttpResponse response = httpClient.execute(request)) {
|
||||||
@ -31,7 +31,7 @@ public class CasValidator {
|
|||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
// return it as a String
|
// return it as a String
|
||||||
result = EntityUtils.toString(entity);
|
result = EntityUtils.toString(entity);
|
||||||
if(result.replace("\n", "").trim().equals("no")){
|
if (result.replace("\n", "").trim().equals("no")) {
|
||||||
throw new CasValidationExcepiton("Validation failed");
|
throw new CasValidationExcepiton("Validation failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user