Class DelegatingAuthenticationEntryPoint.Builder
java.lang.Object
org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint.Builder
- Enclosing class:
- DelegatingAuthenticationEntryPoint
Used to build a new instance of
DelegatingAuthenticationEntryPoint
.- Since:
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptionaddEntryPointFor
(AuthenticationEntryPoint entryPoint, RequestMatcher requestMatcher) Adds anAuthenticationEntryPoint
for the providedRequestMatcher
.build()
Builds theAuthenticationEntryPoint
.defaultEntryPoint
(@Nullable AuthenticationEntryPoint defaultEntryPoint) Set the defaultAuthenticationEntryPoint
if none match.
-
Method Details
-
defaultEntryPoint
public DelegatingAuthenticationEntryPoint.Builder defaultEntryPoint(@Nullable AuthenticationEntryPoint defaultEntryPoint) Set the defaultAuthenticationEntryPoint
if none match. The default is to use the firstAuthenticationEntryPoint
added inaddEntryPointFor(AuthenticationEntryPoint, RequestMatcher)
.- Parameters:
defaultEntryPoint
- the defaultAuthenticationEntryPoint
to use.- Returns:
- the
DelegatingAuthenticationEntryPoint.Builder
for further customization.
-
addEntryPointFor
public DelegatingAuthenticationEntryPoint.Builder addEntryPointFor(AuthenticationEntryPoint entryPoint, RequestMatcher requestMatcher) Adds anAuthenticationEntryPoint
for the providedRequestMatcher
.- Parameters:
entryPoint
- theAuthenticationEntryPoint
to use. Cannot be null.requestMatcher
- theRequestMatcher
to use. Cannot be null.- Returns:
- the
DelegatingAuthenticationEntryPoint.Builder
for further customization.
-
build
Builds theAuthenticationEntryPoint
. If thedefaultEntryPoint(AuthenticationEntryPoint)
is not set, then the firstaddEntryPointFor(AuthenticationEntryPoint, RequestMatcher)
is used as the default. If thedefaultEntryPoint(AuthenticationEntryPoint)
is not set and there is only a singleaddEntryPointFor(AuthenticationEntryPoint, RequestMatcher)
, then theAuthenticationEntryPoint
is returned rather than wrapping it inDelegatingAuthenticationEntryPoint
.- Returns:
- the
AuthenticationEntryPoint
to use.
-