title: spring secuirty anonymous user and authenticated user with spring security
body: <p>Hi am new to spring security.</p>
  
  <p>i had tried with anonymous user for access the application.
  but now i want to implement both anonymous user and authenticated user access the application .can any one help me.</p>
  
  <p>the following security.xml i had used for anonymous users.but now i want to implement anonymous user and authenticated users.(authenticated users sample registered users username and password to checking)</p>
  
  
  
  <pre><code>&lt;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"&gt;
  
      &lt;http pattern="/static/**" security="none" /&gt;
      &lt;http pattern="**/static/**" security="none" /&gt;
      &lt;http pattern="/w/login*" security="none" /&gt;
      &lt;http pattern="/w/about*" security="none" /&gt;    
      &lt;http pattern="/w/getInvolved*" security="none" /&gt;
      &lt;http pattern="/w/faq*" security="none" /&gt;
      &lt;http pattern="/w/feedback*" security="none" /&gt;
      &lt;http pattern="/w/contact*" security="none" /&gt;
      &lt;http pattern="/w/privacy*" security="none" /&gt;
      &lt;http pattern="/w/terms*" security="none" /&gt;
      &lt;http auto-config='true' use-expressions="true"&gt;
  
      &lt;form-login login-page='/w/login' /&gt;
  
      &lt;intercept-url pattern="/w/**" access="isAnonymous()"/&gt;
      &lt;intercept-url pattern="/a/**" access="isAnonymous()"/&gt;
      &lt;logout logout-url="/w/logout"  logout-success-url="/w/login" /&gt;
    &lt;/http&gt;
  
  
    &lt;authentication-manager&gt;
       &lt;authentication-provider user-service-ref="twwiUserSQLMapDAO"&gt;
          &lt;password-encoder hash="sha"&gt;&lt;/password-encoder&gt;
      &lt;/authentication-provider&gt;
    &lt;/authentication-manager&gt;
    &lt;/beans:beans&gt;
  </code></pre>