Hi there,
for having a backend which is offering api's for web (inculding sessions) and mobile apps (stateless) i played a bit with the new multiple http filters and patterns feature.
Weird thing ist that if I set my pattern to (standard) /** my login for the webapp and stuff works as expected. But once i change that to a custom pattern (/web/**) i get a Http 405 post not supported.
Thing is that I could figure out that the submit form is doing exaclty the same thing. But one alternative gives this 405.
i'll add the security.xml here and also add the github link
@security.xml (not working... removing the /web/ from the pattern makes it)
@github:Code:<?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.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <!-- HTTP security configurations --> <http use-expressions="true" pattern="/web/**"> <form-login login-processing-url="/web/resources/j_spring_security_check" login-page="/login" authentication-failure-url="/login?login_error=t" /> <logout logout-url="/resources/j_spring_security_logout" /> <!-- Configure these elements to secure URIs in your application --> <intercept-url pattern="/web/admin/**" access="hasRole('ROLE_ADMIN')" /> <intercept-url pattern="/web/**" access="isAuthenticated()" /> <intercept-url pattern="/resources/**" access="permitAll" /> <intercept-url pattern="/**" access="permitAll" /> </http> <http create-session="stateless" use-expressions="true" pattern="/mobile/**"> <http-basic/> <!-- Configure these elements to secure URIs in your application --> <intercept-url pattern="/mobile/api/" access="isAuthenticated()" /> <intercept-url pattern="/resources/**" access="permitAll" /> </http> <!-- Configure Authentication mechanism --> <authentication-manager alias="authenticationManager"> <!-- SHA-256 values can be produced using 'echo -n your_desired_password | sha256sum' (using normal *nix environments) --> <authentication-provider> <password-encoder hash="sha-256" /> <user-service> <user name="admin" password="8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918" authorities="ROLE_ADMIN" /> <user name="user" password="04f8996da763b7a969b1028ee3007569eaf3a635486ddab211d512c85b9df8fb" authorities="ROLE_USER" /> </user-service> </authentication-provider> </authentication-manager> </beans:beans>
git://github.com/tobiasballing/SpringAndMobileAuthentication.git
thanks for help :/


Reply With Quote

