Example usage for org.apache.shiro.web.filter.authc AuthenticationFilter setSuccessUrl

List of usage examples for org.apache.shiro.web.filter.authc AuthenticationFilter setSuccessUrl

Introduction

In this page you can find the example usage for org.apache.shiro.web.filter.authc AuthenticationFilter setSuccessUrl.

Prototype

public void setSuccessUrl(String successUrl) 

Source Link

Document

Sets the default/fallback success url to use as the default location a user is sent after logging in.

Usage

From source file:com.centfor.frame.shiro.FrameShiroFilterFactoryBean.java

License:Apache License

private void applySuccessUrlIfNecessary(Filter filter) {
    String successUrl = getSuccessUrl();
    if (StringUtils.hasText(successUrl) && (filter instanceof AuthenticationFilter)) {
        AuthenticationFilter authcFilter = (AuthenticationFilter) filter;
        //only apply the successUrl if they haven't explicitly configured one already:
        String existingSuccessUrl = authcFilter.getSuccessUrl();
        if (AuthenticationFilter.DEFAULT_SUCCESS_URL.equals(existingSuccessUrl)) {
            authcFilter.setSuccessUrl(successUrl);
        }//  w  w w .j a  v a  2s  .com
    }
}

From source file:org.panifex.security.shiro.SecurityFilterImpl.java

License:Open Source License

protected void bindSuccessUrlToAuthenticationFilter() {
    AuthenticationFilter authenticationFilter = getAuthenticationFilter();

    if (authenticationFilter != null) {
        log.debug("Bind success url {}", successUrl);
        authenticationFilter.setSuccessUrl(successUrl);
    }/*ww w .  j  a v  a 2s .c o m*/
}

From source file:org.panifex.security.shiro.SecurityFilterImplTest.java

License:Open Source License

private void expectSettingSuccessUrl(String successUrl) {
    AuthenticationFilter filterMock = expectGettingFormAuthenticationFilter();

    // expect setting success url
    filterMock.setSuccessUrl(successUrl);
}