Oracle数据库重启后未经授权的BasicAuth Spring Security请求

时间:2014-05-12 18:34:26

标签: java spring oracle spring-mvc spring-security

我有一个使用BasicAuth和Spring Security的应用程序。凭据和角色存储在数据库中。

对于开发,我使用MySQL和生产Oracle。

问题发生了,只有在Oracle生产中,当数据库在应用程序运行时重新启动时 - 我开始接收org.springframework.web.client.HttpClientErrorException: 401 Unauthorized

这是我的安全背景。

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
            xmlns:beans="http://www.springframework.org/schema/beans"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/security
        http://www.springframework.org/schema/security/spring-security-3.1.xsd">
    <http auto-config='true'>
        <intercept-url pattern="/v**/document/**" access="ROLE_DOCUMENT_USER" />
        <intercept-url pattern="/v**/search/**" access="ROLE_DOCUMENT_USER" />
        <http-basic/>
    </http> 
    <authentication-manager>
        <authentication-provider>
            <password-encoder hash="sha-256">
                <salt-source 
                    system-wide="#{T(com.example.app.data.entity.RestUser).SALT}"/>
            </password-encoder>
            <jdbc-user-service data-source-ref="dataSource"
                    users-by-username-query="select user_nm, password, enabled
                        from rest_usr_t where user_nm = ?" 
                        authorities-by-username-query="select u.user_nm, 
                        ur.authority from rest_usr_t u, rest_authority_t ur where
                        u.user_nm = ur.user_nm and u.user_nm = ?" />
        </authentication-provider>
    </authentication-manager>
    <beans:bean id="restSecurityService"
            class="com.example.app.security.rest.RestSecurityServiceImpl"/>
</beans:beans>

可能导致此问题的任何想法或解决方法?谢谢,/ w

0 个答案:

没有答案