Rest Spring Security-自定义JSON消息,而不是显示登录页面
我希望得到您对以下内容的宝贵反馈。 我一直在处理Spring安全性。我知道,当我通过表单登录登录时,登录处理url将被触发,页面将重定向到spring security登录 但是,当我还没有登录到我的应用程序,但试图通过REST访问任何API URL时,是否可以抛出自定义JSON消息。非常感谢你的帮助 我使用ExtJS进行UI登录,使用Spring作为RESTful服务 想集成这两个视图Spring登录视图和我的自定义ExtJS登录视图吗Rest Spring Security-自定义JSON消息,而不是显示登录页面,rest,spring-security,extjs4.1,spring-security-acl,Rest,Spring Security,Extjs4.1,Spring Security Acl,我希望得到您对以下内容的宝贵反馈。 我一直在处理Spring安全性。我知道,当我通过表单登录登录时,登录处理url将被触发,页面将重定向到spring security登录 但是,当我还没有登录到我的应用程序,但试图通过REST访问任何API URL时,是否可以抛出自定义JSON消息。非常感谢你的帮助 我使用ExtJS进行UI登录,使用Spring作为RESTful服务 想集成这两个视图Spring登录视图和我的自定义ExtJS登录视图吗 <security:http authentic
<security:http authentication-manager-ref="authenticationManager" use-expressions='true' >
<security:form-login login-processing-url="/login" always-use-default-target="true"
default-target-url="/user/authen" username-parameter="uid" password-parameter="password"
authentication-failure-handler-ref="authenticationFailureHandler" />
<security:intercept-url pattern="/login" access="permitAll" />
<security:intercept-url pattern="/**" access="isAuthenticated()" />
<security:intercept-url pattern="/denied" access="permitAll" />
<security:access-denied-handler error-page="/login/accessDenied"/>
<security:logout logout-url="/logout" invalidate-session="true" />
<security:http-basic/>
</security:http>
<bean id="authenticationFailureHandler"
class="org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler">
<property name="exceptionMappings">
<props>
<prop key="org.springframework.security.authentication.BadCredentialsException">/login/badCredentials</prop>
<prop key="org.springframework.security.authentication.CredentialsExpiredException">/login/credentialsExpired</prop>
<prop key="org.springframework.security.authentication.LockedException">/login/accountLocked</prop>
<prop key="org.springframework.security.authentication.DisabledException">/login/accountDisabled</prop>
<prop key="org.springframework.security.authentication.AccessDeniedException">/login/accessDenied</prop>
</props>
</property>
</bean>
R.R.维涅斯瓦兰