Example usage for org.springframework.security.web.authentication LoginUrlAuthenticationEntryPoint setForceHttps

List of usage examples for org.springframework.security.web.authentication LoginUrlAuthenticationEntryPoint setForceHttps

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication LoginUrlAuthenticationEntryPoint setForceHttps.

Prototype

public void setForceHttps(boolean forceHttps) 

Source Link

Document

Set to true to force login form access to be via https.

Usage

From source file:nu.localhost.tapestry5.springsecurity.services.SecurityModule.java

@Marker(SpringSecurityServices.class)
public static AuthenticationEntryPoint buildAuthenticationEntryPoint(
        @Inject @Value("${spring-security.loginform.url}") final String loginFormUrl,
        @Inject @Value("${spring-security.force.ssl.login}") final String forceHttps) throws Exception {

    final LoginUrlAuthenticationEntryPoint entryPoint = new LoginUrlAuthenticationEntryPoint(loginFormUrl);
    entryPoint.afterPropertiesSet();/*from   w w w  . java  2 s  .co m*/
    boolean forceSSL = Boolean.parseBoolean(forceHttps);
    entryPoint.setForceHttps(forceSSL);
    return entryPoint;
}

From source file:ch.astina.hesperid.web.services.SecurityModule.java

/**
 * Web form <code>AuthenticationEntryPoint</code>
 *//*from   ww w  .j ava2  s. c o m*/
@Marker(SpringSecurityServices.class)
public static AuthenticationEntryPoint buildAuthenticationEntryPoint(
        @Inject @Value("${spring-security.loginform.url}") final String loginFormUrl,
        @Inject @Value("${spring-security.force.ssl.login}") final String forceHttps) throws Exception {
    LoginUrlAuthenticationEntryPoint entryPoint = new LoginUrlAuthenticationEntryPoint();
    entryPoint.setLoginFormUrl(loginFormUrl);
    entryPoint.afterPropertiesSet();
    boolean forceSSL = Boolean.parseBoolean(forceHttps);
    entryPoint.setForceHttps(forceSSL);
    return entryPoint;
}