mercredi 15 avril 2015

Specifying ` create - session = " stateless " ` in spring security authentication is created the jsessionid cookies

Should I build service rest statless. In my config file I added



<http create-session="stateless" disable-url-rewriting="true" use-expressions="true">
<intercept-url pattern="/product/**" />
<intercept-url pattern="/*" />
<http-basic />
</http>


and in this way is not created the JSESSIONID


as soon as I add an authentication example



<context:component-scan base-package="training.rest" />
<http create-session="stateless" use-expressions="true">
<intercept-url pattern="/product/**" access="hasRole('ROLE_ADMIN')"/>
<http-basic />
</http>

<authentication-manager alias="authenticationManager">
<authentication-provider>
<user-service>
<user authorities="ROLE_ADMIN" name="user1" password="password1" />
</user-service>
</authentication-provider>
</authentication-manager>


is re- created the JSESSIONID.


how can I solve this problem and make sure you do not create the cookies?


Aucun commentaire:

Enregistrer un commentaire