/
Pac4jDelegatedAuthenticationProperties.java
369 lines (293 loc) · 10.9 KB
/
Pac4jDelegatedAuthenticationProperties.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
package org.apereo.cas.configuration.model.support.pac4j;
import org.apereo.cas.configuration.model.support.pac4j.cas.Pac4jCasClientProperties;
import org.apereo.cas.configuration.model.support.pac4j.oauth.Pac4jOAuth20ClientProperties;
import org.apereo.cas.configuration.model.support.pac4j.oidc.Pac4jOidcClientProperties;
import org.apereo.cas.configuration.model.support.pac4j.saml.Pac4jSamlClientProperties;
import org.apereo.cas.configuration.model.support.saml.idp.SamlIdPDiscoveryProperties;
import org.apereo.cas.configuration.support.RequiresModule;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* This is {@link Pac4jDelegatedAuthenticationProperties}.
*
* @author Misagh Moayyed
* @since 5.0.0
*/
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public class Pac4jDelegatedAuthenticationProperties implements Serializable {
private static final long serialVersionUID = 4388567744591488495L;
/**
* When constructing the final user profile from
* the delegated provider, determines if the provider id
* should be combined with the principal id.
*/
private boolean typedIdUsed;
/**
* The attribute to use as the principal identifier built during and upon a successful authentication attempt.
*/
private String principalAttributeId;
/**
* Whether initialization of delegated identity providers should be done
* eagerly typically during startup.
*/
private boolean lazyInit = true;
/**
* Indicates whether profiles and other session data,
* collected as part of pac4j flows and requests
* that are kept by the container session, should be replicated
* across the cluster using CAS and its own ticket registry.
* Without this option, profile data and other related
* pieces of information should be manually replicated
* via means and libraries outside of CAS.
*/
private boolean replicateSessions = true;
/**
* Handle provisioning ops when establishing profiles
* from external identity providers.
*/
@NestedConfigurationProperty
private Pac4jDelegatedAuthenticationProvisioningProperties provisioning = new Pac4jDelegatedAuthenticationProvisioningProperties();
/**
* Settings that deal with having Facebook as an external delegated-to authentication provider.
*/
private Facebook facebook = new Facebook();
/**
* Settings that deal with having Twitter as an external delegated-to authentication provider.
*/
private Twitter twitter = new Twitter();
/**
* Settings that deal with having SAML2 IdPs as an external delegated-to authentication provider.
*/
private List<Pac4jSamlClientProperties> saml = new ArrayList<>(0);
/**
* Settings that deal with having OpenID Connect Providers as an external delegated-to authentication provider.
*/
private List<Pac4jOidcClientProperties> oidc = new ArrayList<>(0);
/**
* Settings that deal with having OAuth2-capable providers as an external delegated-to authentication provider.
*/
private List<Pac4jOAuth20ClientProperties> oauth2 = new ArrayList<>(0);
/**
* Settings that deal with having CAS Servers as an external delegated-to authentication provider.
*/
private List<Pac4jCasClientProperties> cas = new ArrayList<>(0);
/**
* Settings that deal with having LinkedIn as an external delegated-to authentication provider.
*/
private LinkedIn linkedIn = new LinkedIn();
/**
* Settings that deal with having Dropbox as an external delegated-to authentication provider.
*/
private Dropbox dropbox = new Dropbox();
/**
* Settings that deal with having Orcid as an external delegated-to authentication provider.
*/
private Orcid orcid = new Orcid();
/**
* Settings that deal with having Github as an external delegated-to authentication provider.
*/
private Github github = new Github();
/**
* Settings that deal with having Google as an external delegated-to authentication provider.
*/
private Google google = new Google();
/**
* Settings that deal with having Yahoo as an external delegated-to authentication provider.
*/
private Yahoo yahoo = new Yahoo();
/**
* Settings that deal with having FourSquare as an external delegated-to authentication provider.
*/
private Foursquare foursquare = new Foursquare();
/**
* Settings that deal with having WindowsLive as an external delegated-to authentication provider.
*/
private WindowsLive windowsLive = new WindowsLive();
/**
* Settings that deal with having Paypal as an external delegated-to authentication provider.
*/
private Paypal paypal = new Paypal();
/**
* Settings that deal with having WordPress as an external delegated-to authentication provider.
*/
private Wordpress wordpress = new Wordpress();
/**
* Settings that deal with having BitBucket as an external delegated-to authentication provider.
*/
private Bitbucket bitbucket = new Bitbucket();
/**
* Settings that deal with having HiOrg-Server as an external delegated-to
* authentication provider.
*/
private HiOrgServer hiOrgServer = new HiOrgServer();
/**
* The name of the authentication handler in CAS used for delegation.
*/
private String name;
/**
* Order of the authentication handler in the chain.
*/
private Integer order;
/**
* Settings related to handling saml2 discovery of IdPs.
*/
@NestedConfigurationProperty
private SamlIdPDiscoveryProperties samlDiscovery = new SamlIdPDiscoveryProperties();
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class LinkedIn extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 4633395854143281872L;
/**
* The requested scope.
*/
private String scope;
public LinkedIn() {
setClientName("LinkedIn");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Facebook extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -2737594266552466076L;
/**
* The requested scope.
*/
private String scope;
/**
* Custom fields to include in the request.
*/
private String fields;
public Facebook() {
setClientName("Facebook");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Bitbucket extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -6189494666598669078L;
public Bitbucket() {
setClientName("Bitbucket");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Wordpress extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 4636855941699435914L;
public Wordpress() {
setClientName("Wordpress");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Paypal extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -5663033494303169583L;
public Paypal() {
setClientName("Paypal");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Twitter extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 6906343970517008092L;
/**
* Set to true to request the user's email address from the Twitter API.
* For this to have an effect it must first be enabled in the Twitter developer console.
*/
private boolean includeEmail;
public Twitter() {
setClientName("Twitter");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Github extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 9217581995885784515L;
public Github() {
setClientName("Github");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Yahoo extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 8011580257047982361L;
public Yahoo() {
setClientName("Yahoo");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Foursquare extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -1784820695301605307L;
public Foursquare() {
setClientName("Foursquare");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Dropbox extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -1508055128010569953L;
public Dropbox() {
setClientName("Dropbox");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class HiOrgServer extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -1898237349924741147L;
/**
* The requested scope.
*/
private String scope;
public HiOrgServer() {
setClientName("HiOrg-Server");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Orcid extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = 1337923364401817796L;
public Orcid() {
setClientName("ORCID");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class WindowsLive extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -1816309711278174847L;
public WindowsLive() {
setClientName("Windows Live");
}
}
@RequiresModule(name = "cas-server-support-pac4j-webflow")
@Getter
@Setter
public static class Google extends Pac4jIdentifiableClientProperties {
private static final long serialVersionUID = -3023053058552426312L;
/**
* The requested scope from the provider.
*/
private String scope;
public Google() {
setClientName("Google");
}
}
}