1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.chemistry.opencmis.client.bindings.spi;
20
21 import java.util.List;
22 import java.util.Map;
23
24 import javax.net.ssl.HostnameVerifier;
25 import javax.net.ssl.SSLSocketFactory;
26 import javax.net.ssl.X509TrustManager;
27 import javax.xml.ws.handler.HandlerResolver;
28
29 import org.apache.chemistry.opencmis.commons.SessionParameter;
30 import org.w3c.dom.Element;
31
32
33
34
35 public abstract class AbstractAuthenticationProvider implements SessionAwareAuthenticationProvider {
36
37 private static final long serialVersionUID = 1L;
38
39 private BindingSession session;
40
41
42
43
44 @Override
45 public void setSession(BindingSession session) {
46 this.session = session;
47 }
48
49
50
51
52 public BindingSession getSession() {
53 return session;
54 }
55
56 @Override
57 public Map<String, List<String>> getHTTPHeaders(String url) {
58 return null;
59 }
60
61 @Override
62 public Element getSOAPHeaders(Object portObject) {
63 return null;
64 }
65
66 @Override
67 public HandlerResolver getHandlerResolver() {
68 return null;
69 }
70
71 @Override
72 public void putResponseHeaders(String url, int statusCode, Map<String, List<String>> headers) {
73 }
74
75 @Override
76 public SSLSocketFactory getSSLSocketFactory() {
77 return null;
78 }
79
80 @Override
81 public HostnameVerifier getHostnameVerifier() {
82 return null;
83 }
84
85
86
87
88
89
90 public X509TrustManager getTrustManager() {
91 return null;
92 }
93
94
95
96
97
98
99 protected String getUser() {
100 Object userObject = getSession().get(SessionParameter.USER);
101 if (userObject instanceof String) {
102 return (String) userObject;
103 }
104
105 return null;
106 }
107
108
109
110
111
112
113 protected String getPassword() {
114 Object passwordObject = getSession().get(SessionParameter.PASSWORD);
115 if (passwordObject instanceof String) {
116 return (String) passwordObject;
117 }
118
119 return null;
120 }
121
122
123
124
125
126
127 protected String getBearerToken() {
128 Object tokenObject = getSession().get(SessionParameter.OAUTH_ACCESS_TOKEN);
129 if (tokenObject instanceof String) {
130 return (String) tokenObject;
131 }
132
133 return null;
134 }
135
136
137
138
139
140
141 protected String getProxyUser() {
142 Object userObject = getSession().get(SessionParameter.PROXY_USER);
143 if (userObject instanceof String) {
144 return (String) userObject;
145 }
146
147 return null;
148 }
149
150
151
152
153
154
155 protected String getProxyPassword() {
156 Object passwordObject = getSession().get(SessionParameter.PROXY_PASSWORD);
157 if (passwordObject instanceof String) {
158 return (String) passwordObject;
159 }
160
161 return null;
162 }
163
164
165
166
167
168
169
170 protected String getCsrfHeader() {
171 Object csrfHeaderObject = getSession().get(SessionParameter.CSRF_HEADER);
172 if (csrfHeaderObject instanceof String) {
173 return (String) csrfHeaderObject;
174 }
175
176 return null;
177 }
178 }