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.opensaml.xml.util.DatatypeHelper;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26
27
28
29
30 public class MandatoryIssuerRule implements SecurityPolicyRule {
31
32
33 private final Logger log = LoggerFactory.getLogger(MandatoryIssuerRule.class);
34
35
36 public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
37
38 if (DatatypeHelper.isEmpty(messageContext.getInboundMessageIssuer())) {
39 log.error("Mandatory inbound message context issuer was not present");
40 throw new SecurityPolicyException("Mandatory inbound message context issuer not present");
41 }
42
43 }
44
45 }