CustomUAMCasValidatorTest
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
20d261635b
commit
c24aa73bb0
@ -0,0 +1,28 @@
|
|||||||
|
package com.plannaplan.security.cas;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.jasig.cas.client.validation.Assertion;
|
||||||
|
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
|
||||||
|
import org.jasig.cas.client.validation.TicketValidationException;
|
||||||
|
|
||||||
|
public class CustomUAMCasValidatorTest {
|
||||||
|
@Test
|
||||||
|
public void shouldValidateWithDomain() {
|
||||||
|
/*
|
||||||
|
* TO DO
|
||||||
|
* Dodać case z CAS10/CAS20/CAS30
|
||||||
|
*/
|
||||||
|
Cas20ServiceTicketValidator validator = new Cas20ServiceTicketValidator("https://cas.amu.edu.pl/cas");
|
||||||
|
|
||||||
|
try {
|
||||||
|
Assertion assertion = validator.validate("ST-53723-d0gcC3qovlJhhnKZBhTN-cas.amu.edu.pl","https://wmi.plannaplan.pl");
|
||||||
|
if (assertion == null) {
|
||||||
|
throw new CasValidationExcepiton("Validation failed. Assertion could not be retrieved for ticket " + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (TicketValidationException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user