/
AuthenticationContextConfigurationClient.java
544 lines (500 loc) · 27 KB
/
AuthenticationContextConfigurationClient.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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
/*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wildfly.security.auth.client;
import static org.wildfly.security.auth.client._private.ElytronMessages.log;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URI;
import java.security.AccessControlContext;
import java.security.GeneralSecurityException;
import java.security.Principal;
import java.security.PrivilegedAction;
import java.security.Provider;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslClient;
import javax.security.sasl.SaslClientFactory;
import javax.security.sasl.SaslException;
import org.wildfly.common.Assert;
import org.wildfly.security.SecurityFactory;
import org.wildfly.security.auth.principal.AnonymousPrincipal;
import org.wildfly.security.auth.server.IdentityCredentials;
import org.wildfly.security.auth.server.SecurityDomain;
import org.wildfly.security.auth.server.SecurityIdentity;
import org.wildfly.security.permission.ElytronPermission;
/**
* A client for consuming authentication context configurations.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public final class AuthenticationContextConfigurationClient {
private static final ElytronPermission CREATE_PERMISSION = new ElytronPermission("createAuthenticationContextConfigurationClient");
/**
* A reusable privileged action to create a new configuration client.
*/
public static final PrivilegedAction<AuthenticationContextConfigurationClient> ACTION = AuthenticationContextConfigurationClient::new;
/**
* Construct a new instance. Requires the {@code createAuthenticationContextConfigurationClient} {@link ElytronPermission}.
*
* @throws SecurityException if the caller does not have permission to instantiate this class
*/
public AuthenticationContextConfigurationClient() throws SecurityException {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(CREATE_PERMISSION);
}
}
/**
* Get the authentication configuration which matches the given URI, or {@link AuthenticationConfiguration#EMPTY} if there is none.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @return the matching configuration
*/
public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext) {
return getAuthenticationConfiguration(uri, authenticationContext, -1);
}
/**
* Get the authentication configuration which matches the given URI, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting
* a default protocol port.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @param protocolDefaultPort the protocol-default port
* @return the matching configuration
*/
public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort) {
return getAuthenticationConfiguration(uri, authenticationContext, protocolDefaultPort, null, null);
}
/**
* Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting
* a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already
* establish values for those fields.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @param protocolDefaultPort the protocol-default port
* @param abstractType the abstract type (may be {@code null})
* @param abstractTypeAuthority the abstract type authority (may be {@code null})
* @return the matching configuration
*/
public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("authenticationContext", authenticationContext);
final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority);
AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty();
configuration = initializeConfiguration(uri, configuration);
configuration = establishOverrides(uri, protocolDefaultPort, configuration);
log.tracef("getAuthenticationConfiguration uri=%s, protocolDefaultPort=%d, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]",
uri, protocolDefaultPort, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration);
return configuration;
}
/**
* Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none.
* The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field.
* No host, port, or protocol information is copied to the resultant configuration from the URI.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @param abstractType the abstract type (may be {@code null})
* @param abstractTypeAuthority the abstract type authority (may be {@code null})
* @return the matching configuration
*/
public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("authenticationContext", authenticationContext);
final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority);
AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty();
configuration = initializeConfiguration(uri, configuration);
log.tracef("getAuthenticationConfiguration uri=%s, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]",
uri, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration);
return configuration;
}
@SuppressWarnings("deprecation")
private static AuthenticationConfiguration establishOverrides(final URI uri, final int protocolDefaultPort, AuthenticationConfiguration configuration) {
final String uriHost = uri.getHost();
if (uriHost != null && configuration.setHost == null) {
configuration = configuration.useHost(uriHost);
}
int port = uri.getPort();
if (port == -1) port = protocolDefaultPort;
if (port != -1 && configuration.setPort == -1) {
// use the URI port in this configuration
configuration = configuration.usePort(port);
}
final String scheme = uri.getScheme();
if (scheme != null && configuration.setProtocol == null) {
configuration = configuration.useProtocol(scheme);
}
return configuration;
}
private static AuthenticationConfiguration initializeConfiguration(final URI uri, AuthenticationConfiguration configuration) {
final SecurityDomain authenticationNameForwardSecurityDomain = configuration.authenticationNameForwardSecurityDomain;
final String userInfo = uri.getUserInfo();
if (userInfo != null && configuration.getPrincipal() == AnonymousPrincipal.getInstance() && authenticationNameForwardSecurityDomain == null) {
configuration = configuration.useName(userInfo);
}
// capture forwards
if (authenticationNameForwardSecurityDomain != null) {
configuration = configuration.useForwardedAuthenticationIdentity(null).usePrincipal(authenticationNameForwardSecurityDomain.getCurrentSecurityIdentity().getPrincipal());
}
final SecurityDomain authenticationCredentialsForwardSecurityDomain = configuration.authenticationCredentialsForwardSecurityDomain;
if (authenticationCredentialsForwardSecurityDomain != null) {
final SecurityIdentity securityIdentity = authenticationCredentialsForwardSecurityDomain.getCurrentSecurityIdentity();
final IdentityCredentials privateCredentials = securityIdentity.getPrivateCredentials();
final IdentityCredentials publicCredentials = securityIdentity.getPublicCredentials();
// private overrides public
configuration = configuration.useForwardedAuthenticationCredentials(null).useCredentials(publicCredentials.with(privateCredentials));
}
configuration = configuration.captureAuthorizationIdentity();
if (AuthenticationConfiguration.WILDFLY_ELYTRON_CAPTURE_ACCESS_CONTROL_CONTEXT_PROPERTY) {
final AccessControlContext capturedContext = configuration.getCapturedContext();
if (capturedContext == null) {
configuration = configuration.withCapturedAccessControlContext();
}
}
return configuration;
}
/**
* Get all SSL contexts configured for this authentication context.
*
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @return List of all configured SSL contexts belonging to the provided authentication context
*/
public List<SSLContext> getConfiguredSSLContexts(AuthenticationContext authenticationContext) throws GeneralSecurityException {
List<SSLContext> sslContexts = new ArrayList<>();
if (authenticationContext == null) {
return sslContexts;
}
RuleNode<SecurityFactory<SSLContext>> node = authenticationContext.getSslRules();
while (node != null) {
sslContexts.add(node.getConfiguration().create());
node = node.getNext();
}
return sslContexts;
}
/**
* Get the default SSL context that should be used when no other rules match, or {@link SSLContext#getDefault()} if there is none configured.
*
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @return the default SSL context configured if no other rules match
*/
public SSLContext getDefaultSSLContext(AuthenticationContext authenticationContext) throws GeneralSecurityException {
SSLContext defaultSSLContext = null;
if (authenticationContext == null) {
return SSLContext.getDefault();
}
RuleNode<SecurityFactory<SSLContext>> node = authenticationContext.getSslRules();
while (node != null) {
if (node.getRule().equals(MatchRule.ALL)) {
defaultSSLContext = node.getConfiguration().create();
}
node = node.getNext();
}
return defaultSSLContext == null ? SSLContext.getDefault() : defaultSSLContext;
}
/**
* Get the configured SSL context which matches ALL rules from provided AuthenticationContext, or {@link SSLContext#getDefault()} if there is none.
*
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @return the SSL context from provided AuthenticationContext that matches ALL rules
*/
public SSLContext getSSLContext(AuthenticationContext authenticationContext) throws GeneralSecurityException {
return getSSLContext(null, authenticationContext, null, null);
}
/**
* Get the SSL context which matches the given URI, or {@link SSLContext#getDefault()} if there is none.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @return the matching SSL context
*/
public SSLContext getSSLContext(URI uri, AuthenticationContext authenticationContext) throws GeneralSecurityException {
return getSSLContext(uri, authenticationContext, null, null);
}
/**
* Get the SSL context which matches the given URI and type, or {@link SSLContext#getDefault()} if there is none.
*
* @param uri the URI to match (must not be {@code null})
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @param abstractType the abstract type (may be {@code null})
* @param abstractTypeAuthority the abstract type authority (may be {@code null})
* @return the matching SSL context
*/
public SSLContext getSSLContext(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) throws GeneralSecurityException {
return getSSLContextFactory(uri, authenticationContext, abstractType, abstractTypeAuthority).create();
}
/**
* Get the SSL context factory which matches the given URI and type, or {@link SSLContext#getDefault()} if there is none.
*
* @param uri the URI to match
* @param authenticationContext the authentication context to examine (must not be {@code null})
* @param abstractType the abstract type (may be {@code null})
* @param abstractTypeAuthority the abstract type authority (may be {@code null})
* @return the matching SSL context factory (not {@code null})
*/
public SecurityFactory<SSLContext> getSSLContextFactory(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) {
Assert.checkNotNullParam("authenticationContext", authenticationContext);
final RuleNode<SecurityFactory<SSLContext>> node = authenticationContext.sslRuleMatching(uri, abstractType, abstractTypeAuthority);
if (node == null) return SSLContext::getDefault;
return node.getConfiguration();
}
/**
* Get an authentication callback handler for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the callback handler
*/
public CallbackHandler getCallbackHandler(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
final CallbackHandler callbackHandler = configuration.getUserCallbackHandler();
return callbackHandler == null ? configuration.createCallbackHandler() : callbackHandler;
}
/**
* Get the actual host to use for the given configuration and URI.
*
* @param uri the URI (must not be {@code null})
* @param configuration the configuration (must not be {@code null})
* @return the real host to use
* @deprecated Use {@link URI#getHost()} instead.
*/
@Deprecated
public String getRealHost(URI uri, AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("configuration", configuration);
final String configurationHost = configuration.getHost();
return configurationHost == null ? uri.getHost() : configurationHost;
}
/**
* Get the actual host to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the real host to use
* @deprecated This configuration is not supported by most providers and will be removed in a future release.
*/
@Deprecated
public String getRealHost(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getHost();
}
/**
* Get the actual port to use for the given configuration and URI.
*
* @param uri the URI (must not be {@code null})
* @param configuration the configuration (must not be {@code null})
* @return the real port to use
* @deprecated Use {@link URI#getPort()} instead.
*/
@Deprecated
public int getRealPort(URI uri, AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("configuration", configuration);
final int configurationPort = configuration.getPort();
return configurationPort == -1 ? uri.getPort() : configurationPort;
}
/**
* Get the actual port to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the real port to use
* @deprecated This configuration is not supported by most providers and will be removed in a future release.
*/
@Deprecated
public int getRealPort(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getPort();
}
/**
* Get the actual protocol to use for the given configuration and URI.
*
* @param uri the URI (must not be {@code null})
* @param configuration the configuration (must not be {@code null})
* @return the actual protocol to use, or {@code null} if none is configured and none is present on the URI
* @deprecated Use {@link URI#getScheme()} instead.
*/
@Deprecated
public String getRealProtocol(URI uri, AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("configuration", configuration);
final String protocol = configuration.getProtocol();
return protocol == null ? uri.getScheme() : protocol;
}
/**
* Get the actual protocol to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the actual protocol to use, or {@code null} if none is configured
* @deprecated This configuration is not supported by most providers and will be removed in a future release.
*/
@Deprecated
public String getRealProtocol(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getProtocol();
}
/**
* Get the actual sasl protocol to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the real port to use
*/
public String getSaslProtocol(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getSaslProtocol();
}
/**
* Get the WebServices HTTP mechanism to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the HTTP mechanism to use
*/
public String getWsHttpMech(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getWsHttpMechanism();
}
/**
* Get the actual WS-Security type to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the WS-Security type to use
*/
public String getWsSecurityType(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getWsSecurityType();
}
/**
* Get the authentication principal to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the authentication principal (not {@code null})
*/
public Principal getPrincipal(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getPrincipal();
}
/**
* Get the authorization principal to use for the given configuration.
*
* @param configuration the configuration (must not be {@code null})
* @return the authorization principal, or {@code null} if none is specified
*/
public Principal getAuthorizationPrincipal(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getAuthorizationPrincipal();
}
/**
* Create a SASL client using the given URI and configuration from the given SASL client factory.
*
* @param uri the target URI (must not be {@code null})
* @param configuration the authentication configuration (must not be {@code null})
* @param offeredMechanisms the available mechanisms (must not be {@code null})
* @return the SASL client, or {@code null} if no clients were available or could be configured
*/
public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms) throws SaslException {
return createSaslClient(uri, configuration, offeredMechanisms, UnaryOperator.identity());
}
/**
* Create a SASL client using the given URI and configuration from the given SASL client factory.
*
* @param uri the target URI (must not be {@code null})
* @param configuration the authentication configuration (must not be {@code null})
* @param offeredMechanisms the available mechanisms (must not be {@code null})
* @param factoryOperator a {@link UnaryOperator} to apply to the {@link SaslClientFactory} used
* @return the SASL client, or {@code null} if no clients were available or could be configured
*/
public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms, UnaryOperator<SaslClientFactory> factoryOperator) throws SaslException {
return createSaslClient(uri, configuration, offeredMechanisms, factoryOperator, null);
}
/**
* Create a SASL client using the given URI and configuration from the given SASL client factory.
*
* @param uri the target URI (must not be {@code null})
* @param configuration the authentication configuration (must not be {@code null})
* @param offeredMechanisms the available mechanisms (must not be {@code null})
* @param factoryOperator a {@link UnaryOperator} to apply to the {@link SaslClientFactory} used
* @param sslSession the SSL session active for this connection, or {@code null} for none
* @return the SASL client, or {@code null} if no clients were available or could be configured
*/
public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms, UnaryOperator<SaslClientFactory> factoryOperator, final SSLSession sslSession) throws SaslException {
return configuration.createSaslClient(uri, offeredMechanisms, factoryOperator, sslSession);
}
/**
* Get the address of the destination from a configuration and URI. The configuration may rewrite the destination as needed.
*
* @param uri the connection URI (must not be {@code null})
* @param configuration the authentication configuration to use (must not be {@code null})
* @param protocolDefaultPort the default port for the protocol
* @return the address of the destination
* @deprecated Use {@link org.wildfly.common.net.Inet#getResolved(java.net.URI, int)} instead.
*/
@Deprecated
public InetSocketAddress getDestinationInetSocketAddress(URI uri, AuthenticationConfiguration configuration, int protocolDefaultPort) {
Assert.checkNotNullParam("uri", uri);
Assert.checkNotNullParam("configuration", configuration);
String host = configuration.getHost();
if (host == null) host = uri.getHost();
int port = configuration.getPort();
if (port == -1) port = uri.getPort();
if (port == -1) port = protocolDefaultPort;
return new InetSocketAddress(host, port);
}
/**
* Get the address of the destination from a configuration. The configuration may rewrite the destination as needed.
*
* @param configuration the authentication configuration to use (must not be {@code null})
* @return the address of the destination
* @deprecated This configuration is not supported by most providers and will be removed in a future release.
*/
@Deprecated
public InetSocketAddress getDestinationInetSocketAddress(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return new InetSocketAddress(configuration.getHost(), configuration.getPort());
}
/**
* Connect a plain socket to the given URI.
*
* @param uri the connection URI
* @param configuration the authentication configuration to use
* @param protocolDefaultPort the default port for the protocol used in the URI
* @return the connected socket
* @throws IOException if socket creation or connection fails for some reason
* @deprecated Use {@link org.wildfly.common.net.Inet#getResolved(java.net.URI, int)} with {@link Socket#Socket(InetAddress, int)} instead.
*/
@Deprecated
public Socket connect(URI uri, AuthenticationConfiguration configuration, int protocolDefaultPort) throws IOException {
final InetSocketAddress address = getDestinationInetSocketAddress(uri, configuration, protocolDefaultPort);
return new Socket(address.getAddress(), address.getPort());
}
/**
* Get a {@link Supplier} as a source for all {@link Provider} instances registered in the given {@code configuration}.
*
* @param configuration the authentication configuration to use (must not be {@code null})
* @return a supplier as a source for {@link Provider} instances (not {@code null})
*/
public Supplier<Provider[]> getProviderSupplier(AuthenticationConfiguration configuration) {
Assert.checkNotNullParam("configuration", configuration);
return configuration.getProviderSupplier();
}
}