annotate flys-client/src/main/java/de/intevation/flys/client/server/was/Assertion.java @ 2944:0889ec33249c

Add missing + from last commit flys-client/trunk@4910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Tue, 10 Jul 2012 10:51:20 +0000
parents 7683d4e43afa
children
rev   line source
2943
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.server.was;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
2
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
3 import java.text.ParseException;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
4 import java.text.SimpleDateFormat;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
5 import java.util.Iterator;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
6 import java.util.Date;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
7 import java.util.List;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
8 import java.util.LinkedList;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
9
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10 import org.apache.log4j.Logger;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
11
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
12 import org.jdom.Element;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
13
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
14 public class Assertion {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 private static Logger logger = Logger.getLogger(Assertion.class);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
17
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
18 private Element assertion;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
19 private LinkedList<String> roles;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20 private String assertion_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
21 private String user_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
22 private String name_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
23 private String group_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
24 private String group_name;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
25 private Date notbefore;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
26 private Date notonorafter;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
27 private Signature signature;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
28
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
29 private static final String ATTR_CONT_USER_ID =
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
30 "urn:conterra:names:sdi-suite:policy:attribute:user-id";
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
31 private static final String ATTR_CONT_GROUP_ID =
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
32 "urn:conterra:names:sdi-suite:policy:attribute:group-id";
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
33 private static final String ATTR_CONT_GROUP_NAME =
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
34 "urn:conterra:names:sdi-suite:policy:attribute:group-name";
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
35 private static final String ATTR_CONT_ROLE =
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
36 "urn:conterra:names:sdi-suite:policy:attribute:role";
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
37
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
39 public Assertion(Element assertion) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40 this.assertion = assertion;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
41 this.roles = new LinkedList<String>();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
42
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
43 this.assertion_id = assertion.getAttributeValue("AssertionID");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
44
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
45 this.parseContition();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
46 this.parseAttributeStatement();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
47 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
48
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
49 private void parseContition() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
50 Element condition = this.assertion.getChild("Conditions",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
51 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
52 if (condition != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
53 SimpleDateFormat dateformat = new SimpleDateFormat();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
54 // format should be "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" but that's only
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
55 // available in java 7+
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
56 dateformat.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
57 String from = condition.getAttributeValue("NotBefore");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
58 if (from != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
59 try {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
60 this.notbefore = dateformat.parse(from);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
61 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
62 catch(ParseException e) {
2944
0889ec33249c Add missing + from last commit
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2943
diff changeset
63 logger.error("Unknown datetime format for Condition " +
2943
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
64 "NotBefore " + from);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
65 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
66 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
67
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
68 String until = condition.getAttributeValue("NotOnOrAfter");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
69 if (until != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
70 try {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
71 this.notonorafter = dateformat.parse(until);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
72 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
73 catch(ParseException e) {
2944
0889ec33249c Add missing + from last commit
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2943
diff changeset
74 logger.error("Unknown datetime format for Condition " +
2943
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
75 "NotOnOrAfter " + until);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
76 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
77 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
78 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
79 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
80
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
81 private void parseAttributeStatement() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
82 Element attrstatement = this.assertion.getChild("AttributeStatement",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
83 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
84 if (attrstatement != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
85
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
86 Element subject = attrstatement.getChild("Subject",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
87 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
88 if (subject != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
89 this.name_id = subject.getChildText("NameIdentifier",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
90 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
91 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
92
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
93 List attributes = attrstatement.getChildren("Attribute",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
94 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
95 for(Iterator i = attributes.iterator(); i.hasNext();) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
96 Element attr = (Element)i.next();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
97 String attrname = attr.getAttributeValue("AttributeName");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
98 if (attrname.equals(ATTR_CONT_USER_ID)) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
99 this.user_id = this.getAttributeValue(attr);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
100 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
101 else if (attrname.equals(ATTR_CONT_GROUP_ID)) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
102 this.group_id = this.getAttributeValue(attr);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
103 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
104 else if (attrname.equals(ATTR_CONT_GROUP_NAME)) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
105 this.group_name = this.getAttributeValue(attr);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
106 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
107 else if (attrname.equals(ATTR_CONT_ROLE)) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
108 List roles = attr.getChildren("AttributeValue",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
109 Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
110 for(Iterator j = roles.iterator(); j.hasNext();) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
111 Element role = (Element)j.next();
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
112 this.roles.add(role.getText());
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
113 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
114 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
115 else {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
116 logger.debug("Unknown AttributeName " + attrname +
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
117 " found while parsing AttributeStatement.");
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
118 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
119 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
120 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
121 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
122
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
123 private String getAttributeValue(Element attr) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
124 return attr.getChildText("AttributeValue", Namespaces.SAML_NS_ASSERT);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
125 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
126
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
127 public List<String> getRoles() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
128 return this.roles;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
129 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
130
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
131 public Boolean isValid() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
132 // TODO:
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
133 // check signature digest
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
134 // check signature value
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
135 // check signature cert
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
136 return false;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
137 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
138
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
139 public Signature getSiganture() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
140 if (this.signature == null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
141 Element signature = this.assertion.getChild("Signature",
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
142 Namespaces.XML_SIG_NS);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
143 if (signature != null) {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
144 this.signature = new Signature(signature);
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
145 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
146 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
147 return this.signature;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
148 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
149
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
150 public String getUserID() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
151 return this.user_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
152 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
153
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
154 public String getNameID() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
155 return this.name_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
156 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
157
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
158 public String getGroupID() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
159 return this.group_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
160 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
161
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
162 public String getGroupName() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
163 return this.group_name;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
164 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
165
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
166 public String getID() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
167 return this.assertion_id;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
168 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
169
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
170 public Date getFrom() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
171 return this.notbefore;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
172 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
173
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
174 public Date getUntil() {
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
175 return this.notonorafter;
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
176 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
177 }
7683d4e43afa Implement class representation of a Web Authentication Service (WAS)
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
178 // vim: set fileencoding=utf-8 ts=4 sw=4 et si tw=80:

http://dive4elements.wald.intevation.org