add CAS authentication #138

Merged
hsh-michaelhoennig merged 24 commits from feature/add-cas-authentication into master 2024-12-23 12:49:46 +01:00
3 changed files with 2 additions and 3 deletions
Showing only changes of commit 2338c3cc57 - Show all commits

View File

@ -25,7 +25,7 @@ public class CasAuthenticationFilter implements Filter {
final var ticket = httpRequest.getHeader("Authorization"); final var ticket = httpRequest.getHeader("Authorization");
if (ticket == null || !ticketValidator.validateTicket(ticket)) { if (!ticketValidator.validateTicket(ticket)) {
httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return; return;
} }

View File

@ -22,7 +22,7 @@ public class CasServiceTicketValidator {
@SneakyThrows @SneakyThrows
public boolean validateTicket(final String ticket) { public boolean validateTicket(final String ticket) {
if (casServerUrl.equals("fake") && ticket.equals("test")) { if (casServerUrl.equals("fake")) {
return true; return true;
} }

View File

@ -207,7 +207,6 @@ public abstract class UseCase<T extends UseCase<?>> {
.uri(new URI("http://localhost:" + testSuite.port + uriPath)) .uri(new URI("http://localhost:" + testSuite.port + uriPath))
.header("Content-Type", "application/json") .header("Content-Type", "application/json")
.header("current-subject", ScenarioTest.RUN_AS_USER) .header("current-subject", ScenarioTest.RUN_AS_USER)
.header("Authorization", "test")
.timeout(seconds(10)) .timeout(seconds(10))
.build(); .build();
final var response = client.send(request, BodyHandlers.ofString()); final var response = client.send(request, BodyHandlers.ofString());