1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.ws.security.provider;
18
19 import org.opensaml.ws.message.MessageContext;
20 import org.opensaml.ws.security.SecurityPolicyException;
21 import org.opensaml.ws.security.SecurityPolicyRule;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24
25
26
27
28 public class MandatoryAuthenticatedMessageRule implements SecurityPolicyRule {
29
30
31 private final Logger log = LoggerFactory.getLogger(MandatoryAuthenticatedMessageRule.class);
32
33
34 public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
35 if(!messageContext.isIssuerAuthenticated()) {
36 log.error("Inbound message issuer was not authenticated.");
37 throw new SecurityPolicyException("Inbound message issuer was not authenticated.");
38 }
39 }
40 }