Hi,

For some reason shiro is not redirecting to successUrl but the login is
successful.
If i go to the successUrl after login everything works fine.

Can someone please help?

My config:

web.xml:
    <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>
                        /WEB-INF/applicationContext.xml
                </param-value>
        </context-param>


        <listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

        <filter>
        <filter-name>shiroFilter</filter-name>

<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
                <param-name>targetFilterLifecycle</param-name>
                <param-value>true</param-value>
        </init-param>
        </filter>
        <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>

    <listener>

<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>



applicationContext.xml

        <bean id="securityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
        <property name="realm" ref="jdbcRealm" />
    </bean>

        <bean id="passwordService"
class="org.apache.shiro.authc.credential.DefaultPasswordService">
                <property name="hashService.hashAlgorithmName"
value="SHA-512"/>
                <property name="hashService.hashIterations" value="500000"/>
        </bean>

    <bean id="sessionManager"
class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
    </bean>

        <bean id="jdbcRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
        <property name="credentialsMatcher">
            <bean class="org.apache.shiro.authc.credential.PasswordMatcher">
                <property name="passwordService" ref="passwordService"/>
                </bean>
        </property>
        <property name="name" value="jdbcRealm" />
        <property name="dataSource" ref="dataSource" />
        <property name="authenticationQuery"
            value="SELECT sus_password FROM sec_users WHERE sus_username=?
AND sus_enabled=1" />
    </bean>

        <bean id="lifecycleBeanPostProcessor"
class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />

    <bean id="annotationProxy"
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor" />

    <bean id="annotationProxy"
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor" />

    <bean
class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
        <property name="securityManager" ref="securityManager" />
    </bean>

        <bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="loginUrl" value="/login.jsp"/>
        <property name="successUrl" value="/app"/>
        <property name="unauthorizedUrl" value="/login.jsp?login_error=1"/>
        <property name="filterChainDefinitions">
                <value>
                    /assets/** = anon
                    /login.jsp = authc
                    /** = authc
                </value>
        </property>
        </bean>

--
Ystävällisin terveisin / Best Regards,
Petri Turunen



Reply via email to