add CAS authentication #138
@ -25,7 +25,7 @@ public class CasAuthenticationFilter implements Filter {
|
||||
|
||||
final var ticket = httpRequest.getHeader("Authorization");
|
||||
|
||||
if (ticket == null || !ticketValidator.validateTicket(ticket)) {
|
||||
if (!ticketValidator.validateTicket(ticket)) {
|
||||
httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class CasServiceTicketValidator {
|
||||
|
||||
@SneakyThrows
|
||||
public boolean validateTicket(final String ticket) {
|
||||
if (casServerUrl.equals("fake") && ticket.equals("test")) {
|
||||
if (casServerUrl.equals("fake")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,6 @@ public abstract class UseCase<T extends UseCase<?>> {
|
||||
.uri(new URI("http://localhost:" + testSuite.port + uriPath))
|
||||
.header("Content-Type", "application/json")
|
||||
.header("current-subject", ScenarioTest.RUN_AS_USER)
|
||||
.header("Authorization", "test")
|
||||
.timeout(seconds(10))
|
||||
.build();
|
||||
final var response = client.send(request, BodyHandlers.ofString());
|
||||
|
Loading…
Reference in New Issue
Block a user