/** * Specifies a custom {@link AuthenticationDetailsSource}. The default is * {@link WebAuthenticationDetailsSource}. * * @param authenticationDetailsSource the custom {@link AuthenticationDetailsSource} * @return the {@link FormLoginConfigurer} for additional customization */ public final T authenticationDetailsSource( AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource) { this.authenticationDetailsSource = authenticationDetailsSource; return getSelf(); }
/** * Specifies the {@link AuthenticationSuccessHandler} to be used. The default is * {@link SavedRequestAwareAuthenticationSuccessHandler} with no additional properites * set. * * @param successHandler the {@link AuthenticationSuccessHandler}. * @return the {@link FormLoginConfigurer} for additional customization */ public final T successHandler(AuthenticationSuccessHandler successHandler) { this.successHandler = successHandler; return getSelf(); }
/** * Ensures the urls for {@link #failureUrl(String)} as well as for the {@link HttpSecurityBuilder}, the * {@link #getLoginPage} and {@link #getLoginProcessingUrl} are granted access to any user. * * @param permitAll true to grant access to the URLs false to skip this step * @return the {@link FormLoginConfigurer} for additional customization */ public final T permitAll(boolean permitAll) { this.permitAll = permitAll; return getSelf(); }
/** * Specifies the {@link AuthenticationFailureHandler} to use when authentication * fails. The default is redirecting to "/login?error" using * {@link SimpleUrlAuthenticationFailureHandler} * * @param authenticationFailureHandler the {@link AuthenticationFailureHandler} to use * when authentication fails. * @return the {@link FormLoginConfigurer} for additional customization */ public final T failureHandler( AuthenticationFailureHandler authenticationFailureHandler) { this.failureUrl = null; this.failureHandler = authenticationFailureHandler; return getSelf(); }
/** * Specifies the URL to validate the credentials. * * @param loginProcessingUrl the URL to validate username and password * @return the {@link FormLoginConfigurer} for additional customization */ public T loginProcessingUrl(String loginProcessingUrl) { this.loginProcessingUrl = loginProcessingUrl; authFilter .setRequiresAuthenticationRequestMatcher(createLoginProcessingUrlMatcher(loginProcessingUrl)); return getSelf(); }
/** * <p> * Specifies the URL to send users to if login is required. If used with * {@link WebSecurityConfigurerAdapter} a default login page will be generated when * this attribute is not specified. * </p> * * <p> * If a URL is specified or this is not being used in conjuction with * {@link WebSecurityConfigurerAdapter}, users are required to process the specified * URL to generate a login page. * </p> */ protected T loginPage(String loginPage) { setLoginPage(loginPage); updateAuthenticationDefaults(); this.customLoginPage = true; return getSelf(); }
/** * Specifies a custom {@link AuthenticationDetailsSource}. The default is * {@link WebAuthenticationDetailsSource}. * * @param authenticationDetailsSource the custom {@link AuthenticationDetailsSource} * @return the {@link FormLoginConfigurer} for additional customization */ public final T authenticationDetailsSource( AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource) { this.authenticationDetailsSource = authenticationDetailsSource; return getSelf(); }
/** * Ensures the urls for {@link #failureUrl(String)} as well as for the {@link HttpSecurityBuilder}, the * {@link #getLoginPage} and {@link #getLoginProcessingUrl} are granted access to any user. * * @param permitAll true to grant access to the URLs false to skip this step * @return the {@link FormLoginConfigurer} for additional customization */ public final T permitAll(boolean permitAll) { this.permitAll = permitAll; return getSelf(); }
/** * Specifies the {@link AuthenticationSuccessHandler} to be used. The default is * {@link SavedRequestAwareAuthenticationSuccessHandler} with no additional properites * set. * * @param successHandler the {@link AuthenticationSuccessHandler}. * @return the {@link FormLoginConfigurer} for additional customization */ public final T successHandler(AuthenticationSuccessHandler successHandler) { this.successHandler = successHandler; return getSelf(); }
/** * Specifies the {@link AuthenticationFailureHandler} to use when authentication * fails. The default is redirecting to "/login?error" using * {@link SimpleUrlAuthenticationFailureHandler} * * @param authenticationFailureHandler the {@link AuthenticationFailureHandler} to use * when authentication fails. * @return the {@link FormLoginConfigurer} for additional customization */ public final T failureHandler( AuthenticationFailureHandler authenticationFailureHandler) { this.failureUrl = null; this.failureHandler = authenticationFailureHandler; return getSelf(); }
/** * Specifies the URL to validate the credentials. * * @param loginProcessingUrl the URL to validate username and password * @return the {@link FormLoginConfigurer} for additional customization */ public T loginProcessingUrl(String loginProcessingUrl) { this.loginProcessingUrl = loginProcessingUrl; authFilter .setRequiresAuthenticationRequestMatcher(createLoginProcessingUrlMatcher(loginProcessingUrl)); return getSelf(); }
/** * <p> * Specifies the URL to send users to if login is required. If used with * {@link WebSecurityConfigurerAdapter} a default login page will be generated when * this attribute is not specified. * </p> * * <p> * If a URL is specified or this is not being used in conjuction with * {@link WebSecurityConfigurerAdapter}, users are required to process the specified * URL to generate a login page. * </p> */ protected T loginPage(String loginPage) { setLoginPage(loginPage); updateAuthenticationDefaults(); this.customLoginPage = true; return getSelf(); }
/** * Specifies a custom {@link AuthenticationDetailsSource}. The default is {@link WebAuthenticationDetailsSource}. * * @param authenticationDetailsSource the custom {@link AuthenticationDetailsSource} * @return the {@link FormLoginConfigurer} for additional customization */ public final T authenticationDetailsSource(AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource) { this.authenticationDetailsSource = authenticationDetailsSource; return getSelf(); }
/** * Ensures the urls for {@link #failureUrl(String)} and * {@link #loginUrl(String)} are granted access to any user. * * @param permitAll true to grant access to the URLs false to skip this step * @return the {@link FormLoginConfigurer} for additional customization */ public final T permitAll(boolean permitAll) { this.permitAll = permitAll; return getSelf(); }
/** * Specifies a custom {@link AuthenticationDetailsSource}. The default is * {@link WebAuthenticationDetailsSource}. * * @param authenticationDetailsSource the custom {@link AuthenticationDetailsSource} * @return the {@link FormLoginConfigurer} for additional customization */ public final T authenticationDetailsSource( AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource) { this.authenticationDetailsSource = authenticationDetailsSource; return getSelf(); }
/** * Specifies the {@link AuthenticationSuccessHandler} to be used. The default is * {@link SavedRequestAwareAuthenticationSuccessHandler} with no additional properites * set. * * @param successHandler the {@link AuthenticationSuccessHandler}. * @return the {@link FormLoginConfigurer} for additional customization */ public final T successHandler(AuthenticationSuccessHandler successHandler) { this.successHandler = successHandler; return getSelf(); }
/** * Specifies the {@link AuthenticationSuccessHandler} to be used. The * default is {@link SavedRequestAwareAuthenticationSuccessHandler} with no * additional properites set. * * @param successHandler * the {@link AuthenticationSuccessHandler}. * @return the {@link FormLoginConfigurer} for additional customization */ public final T successHandler(AuthenticationSuccessHandler successHandler) { this.successHandler = successHandler; return getSelf(); }
/** * Ensures the urls for {@link #failureUrl(String)} as well as for the {@link HttpSecurityBuilder}, the * {@link #getLoginPage} and {@link #getLoginProcessingUrl} are granted access to any user. * * @param permitAll true to grant access to the URLs false to skip this step * @return the {@link FormLoginConfigurer} for additional customization */ public final T permitAll(boolean permitAll) { this.permitAll = permitAll; return getSelf(); }
/** * Specifies the URL to validate the credentials. * * @param loginProcessingUrl * the URL to validate username and password * @return the {@link FormLoginConfigurer} for additional customization */ public T loginProcessingUrl(String loginProcessingUrl) { this.loginProcessingUrl = loginProcessingUrl; authFilter.setFilterProcessesUrl(loginProcessingUrl); return getSelf(); }
/** * Specifies the URL to validate the credentials. * * @param loginProcessingUrl the URL to validate username and password * @return the {@link FormLoginConfigurer} for additional customization */ public T loginProcessingUrl(String loginProcessingUrl) { this.loginProcessingUrl = loginProcessingUrl; authFilter .setRequiresAuthenticationRequestMatcher(createLoginProcessingUrlMatcher(loginProcessingUrl)); return getSelf(); }