|
1
|
|
|
package org.apereo.cas.configuration.model.support.mfa; |
|
2
|
|
|
|
|
3
|
|
|
import org.apereo.cas.configuration.support.RequiresModule; |
|
4
|
|
|
import org.apereo.cas.configuration.support.RestEndpointProperties; |
|
5
|
|
|
import org.apereo.cas.configuration.support.SpringResourceProperties; |
|
6
|
|
|
|
|
7
|
|
|
import java.io.Serializable; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* This is {@link MultifactorAuthenticationProviderBypassProperties}. |
|
11
|
|
|
* |
|
12
|
|
|
* @author Misagh Moayyed |
|
13
|
|
|
* @since 5.2.0 |
|
14
|
|
|
*/ |
|
15
|
|
|
@RequiresModule(name = "cas-server-core-authentication", automated = true) |
|
16
|
|
|
public class MultifactorAuthenticationProviderBypassProperties implements Serializable { |
|
17
|
|
|
private static final long serialVersionUID = -9181362378365850397L; |
|
18
|
|
|
|
|
19
|
|
|
public enum MultifactorProviderBypassTypes { |
|
20
|
|
|
/** |
|
21
|
|
|
* Handle multifactor authentication bypass per default CAS rules. |
|
22
|
|
|
*/ |
|
23
|
|
|
DEFAULT, |
|
24
|
|
|
/** |
|
25
|
|
|
* Handle multifactor authentication bypass via a Groovy script. |
|
26
|
|
|
*/ |
|
27
|
|
|
GROOVY, |
|
28
|
|
|
/** |
|
29
|
|
|
* Handle multifactor authentication bypass via a REST endpoint. |
|
30
|
|
|
*/ |
|
31
|
|
|
REST |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Acceptable values are: |
|
36
|
|
|
* <ul> |
|
37
|
|
|
* <li>{@code DEFAULT}: Default bypass rules to skip provider via attributes, etc.</li> |
|
38
|
|
|
* <li>{@code GROOVY}: Handle bypass decisions via a groovy script.</li> |
|
39
|
|
|
* <li>{@code REST}: Handle bypass rules via a REST endpoint</li> |
|
40
|
|
|
* </ul> |
|
41
|
|
|
*/ |
|
42
|
|
|
private MultifactorProviderBypassTypes type = MultifactorProviderBypassTypes.DEFAULT; |
|
43
|
|
|
/** |
|
44
|
|
|
* Skip multifactor authentication based on designated principal attribute names. |
|
45
|
|
|
*/ |
|
46
|
|
|
private String principalAttributeName; |
|
47
|
|
|
/** |
|
48
|
|
|
* Optionally, skip multifactor authentication based on designated principal attribute values. |
|
49
|
|
|
*/ |
|
50
|
|
|
private String principalAttributeValue; |
|
51
|
|
|
/** |
|
52
|
|
|
* Skip multifactor authentication based on designated authentication attribute names. |
|
53
|
|
|
*/ |
|
54
|
|
|
private String authenticationAttributeName; |
|
55
|
|
|
/** |
|
56
|
|
|
* Optionally, skip multifactor authentication based on designated authentication attribute values. |
|
57
|
|
|
*/ |
|
58
|
|
|
private String authenticationAttributeValue; |
|
59
|
|
|
/** |
|
60
|
|
|
* Skip multifactor authentication depending on form of primary authentication execution. |
|
61
|
|
|
* Specifically, skip multifactor if the a particular authentication handler noted by its name |
|
62
|
|
|
* successfully is able to authenticate credentials in the primary factor. |
|
63
|
|
|
*/ |
|
64
|
|
|
private String authenticationHandlerName; |
|
65
|
|
|
/** |
|
66
|
|
|
* Skip multifactor authentication depending on method/form of primary authentication execution. |
|
67
|
|
|
* Specifically, skip multifactor if the authentication method attribute collected as part of |
|
68
|
|
|
* authentication metadata matches a certain value. |
|
69
|
|
|
*/ |
|
70
|
|
|
private String authenticationMethodName; |
|
71
|
|
|
/** |
|
72
|
|
|
* Skip multifactor authentication depending on form of primary credentials. |
|
73
|
|
|
* Value must equal the fully qualified class name of the credential type. |
|
74
|
|
|
*/ |
|
75
|
|
|
private String credentialClassType; |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Skip multifactor authentication if the http request's remote address or host |
|
79
|
|
|
* matches the value defined here. The value may be specified as a regular expression. |
|
80
|
|
|
*/ |
|
81
|
|
|
private String httpRequestRemoteAddress; |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* Skip multifactor authentication if the http request contains the defined header names. |
|
85
|
|
|
* Header names may be comma-separated and can be regular expressions; values are ignored. |
|
86
|
|
|
*/ |
|
87
|
|
|
private String httpRequestHeaders; |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* Handle bypass using a Groovy resource. |
|
91
|
|
|
*/ |
|
92
|
|
|
private Groovy groovy = new Groovy(); |
|
93
|
|
|
/** |
|
94
|
|
|
* Handle bypass using a REST endpoint. |
|
95
|
|
|
*/ |
|
96
|
|
|
private Rest rest = new Rest(); |
|
97
|
|
|
|
|
98
|
|
|
public String getCredentialClassType() { |
|
99
|
|
|
return credentialClassType; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public void setCredentialClassType(final String credentialClassType) { |
|
103
|
|
|
this.credentialClassType = credentialClassType; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public String getAuthenticationAttributeName() { |
|
107
|
|
|
return authenticationAttributeName; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
public void setAuthenticationAttributeName(final String authenticationAttributeName) { |
|
111
|
|
|
this.authenticationAttributeName = authenticationAttributeName; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
public String getAuthenticationAttributeValue() { |
|
115
|
|
|
return authenticationAttributeValue; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public void setAuthenticationAttributeValue(final String authenticationAttributeValue) { |
|
119
|
|
|
this.authenticationAttributeValue = authenticationAttributeValue; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
public String getPrincipalAttributeName() { |
|
123
|
|
|
return principalAttributeName; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
public void setPrincipalAttributeName(final String principalAttributeName) { |
|
127
|
|
|
this.principalAttributeName = principalAttributeName; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public String getPrincipalAttributeValue() { |
|
131
|
|
|
return principalAttributeValue; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
public void setPrincipalAttributeValue(final String principalAttributeValue) { |
|
135
|
|
|
this.principalAttributeValue = principalAttributeValue; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
public String getAuthenticationHandlerName() { |
|
139
|
|
|
return authenticationHandlerName; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
public void setAuthenticationHandlerName(final String authenticationHandlerName) { |
|
143
|
|
|
this.authenticationHandlerName = authenticationHandlerName; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
public String getAuthenticationMethodName() { |
|
147
|
|
|
return authenticationMethodName; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
public void setAuthenticationMethodName(final String authenticationMethodName) { |
|
151
|
|
|
this.authenticationMethodName = authenticationMethodName; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
public MultifactorProviderBypassTypes getType() { |
|
155
|
|
|
return type; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
public void setType(final MultifactorProviderBypassTypes type) { |
|
159
|
|
|
this.type = type; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
public Groovy getGroovy() { |
|
163
|
|
|
return groovy; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
public void setGroovy(final Groovy groovy) { |
|
167
|
|
|
this.groovy = groovy; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
public Rest getRest() { |
|
171
|
|
|
return rest; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
public void setRest(final Rest rest) { |
|
175
|
|
|
this.rest = rest; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public String getHttpRequestRemoteAddress() { |
|
179
|
|
|
return httpRequestRemoteAddress; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
public void setHttpRequestRemoteAddress(final String httpRequestRemoteAddress) { |
|
183
|
|
|
this.httpRequestRemoteAddress = httpRequestRemoteAddress; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
public String getHttpRequestHeaders() { |
|
187
|
|
|
return httpRequestHeaders; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
public void setHttpRequestHeaders(final String httpRequestHeaders) { |
|
191
|
|
|
this.httpRequestHeaders = httpRequestHeaders; |
|
192
|
|
|
} |
|
193
|
|
|
|
|
194
|
|
|
@RequiresModule(name = "cas-server-core-authentication", automated = true) |
|
195
|
|
|
public static class Groovy extends SpringResourceProperties { |
|
196
|
|
|
private static final long serialVersionUID = 8079027843747126083L; |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
@RequiresModule(name = "cas-server-core-authentication", automated = true) |
|
200
|
|
|
public static class Rest extends RestEndpointProperties { |
|
201
|
|
|
private static final long serialVersionUID = 1833594332973137011L; |
|
202
|
|
|
} |
|
203
|
|
|
} |
|
204
|
|
|
|