Skip to content
Snippets Groups Projects
Commit b9f2d2f6 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6858 add logging; move method

parent bd20005a
No related branches found
No related tags found
No related merge requests found
...@@ -164,21 +164,22 @@ public class AntragraumService { ...@@ -164,21 +164,22 @@ public class AntragraumService {
return nachricht; return nachricht;
} }
void verifyToken(String token) {
var errors = verifier.verify(token);
if (CollectionUtils.isNotEmpty(errors)) {
throw new SecurityException("SAML Token verification failed. Errors: %s".formatted(errors));
}
}
void verifyPostfachId(String samlToken, PostfachNachricht nachricht) { void verifyPostfachId(String samlToken, PostfachNachricht nachricht) {
var vorgang = vorgangService.getVorgang(nachricht.getVorgangId()); var vorgang = vorgangService.getVorgang(nachricht.getVorgangId());
if (!StringUtils.equals(vorgang.getPostfachId(), getPostfachId(samlToken))) { if (!StringUtils.equals(vorgang.getPostfachId(), getPostfachId(samlToken))) {
LOG.info("PostfachId in token is not matching postfachId in vorgang.");
throw new NotFoundException(GenericId.from(nachricht.getId()), "PostfachNachricht"); throw new NotFoundException(GenericId.from(nachricht.getId()), "PostfachNachricht");
} }
} }
void verifyToken(String token) {
var errors = verifier.verify(token);
if (CollectionUtils.isNotEmpty(errors)) {
throw new SecurityException("SAML Token verification failed. Errors: %s".formatted(errors));
}
}
public boolean isAccessible(String samlToken, String trustLevel) { public boolean isAccessible(String samlToken, String trustLevel) {
return getTrustLevel(samlToken).getIntValue() >= TrustLevel.fromString(trustLevel).getIntValue(); return getTrustLevel(samlToken).getIntValue() >= TrustLevel.fromString(trustLevel).getIntValue();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment