Class ExceptionHandlingConfigurer
java.lang.Object
com.codename1.backend.security.SecurityConfigurer
com.codename1.backend.security.ExceptionHandlingConfigurer
How a chain answers a request that must sign in, and one that may not have what it asked for.
http.exceptionHandling(handling -> handling
.authenticationEntryPoint(new HttpStatusEntryPoint(401))
.accessDeniedHandler((request, denied) ->
HttpServer.Response.json(403, "{\"error\":\"forbidden\"}")));
Without an entry point set here, form login's is the answer -- a redirect to the login page -- and HTTP Basic's challenge when that is the only way in, or when a script made the request. A chain with neither answers 403.
-
Method Summary
Modifier and TypeMethodDescriptionaccessDeniedHandler(AccessDeniedHandler handler) What answers a signed-in caller that is denied; a 403 unless set.authenticationEntryPoint(AuthenticationEntryPoint entryPoint) The entry point for every request under the chain.voidconfigure(HttpSecurity http) Adds this part's filters; nothing by default.defaultAccessDeniedHandlerFor(AccessDeniedHandler handler, RequestMatcher preferredMatcher) A handler for the denied requestspreferredMatchermatches, used when no single handler is set.defaultAuthenticationEntryPointFor(AuthenticationEntryPoint entryPoint, RequestMatcher preferredMatcher) An entry point for the requestspreferredMatchermatches, used when no single entry point is set.Methods inherited from class SecurityConfigurer
disable, getBuilder, init
-
Method Details
-
authenticationEntryPoint
The entry point for every request under the chain. -
accessDeniedHandler
What answers a signed-in caller that is denied; a 403 unless set. -
defaultAuthenticationEntryPointFor
public ExceptionHandlingConfigurer defaultAuthenticationEntryPointFor(AuthenticationEntryPoint entryPoint, RequestMatcher preferredMatcher) An entry point for the requestspreferredMatchermatches, used when no single entry point is set. The first one added also answers the requests none of them matches. -
defaultAccessDeniedHandlerFor
public ExceptionHandlingConfigurer defaultAccessDeniedHandlerFor(AccessDeniedHandler handler, RequestMatcher preferredMatcher) A handler for the denied requestspreferredMatchermatches, used when no single handler is set. A denied request none of them matches is answered 403. -
configure
Description copied from class:SecurityConfigurerAdds this part's filters; nothing by default.- Overrides:
configurein classSecurityConfigurer
-