title: get Token parameter in action with symfony2
body: <p>i have created login form manually and set credential in security controller like below</p>
  
  <pre><code> public function loginCheckAction()
  {
      $request = $this-&gt;getRequest();
      $session = $request-&gt;getSession();
  
              $oem = $this-&gt;getDoctrine()-&gt;getEntityManager();
              $username = $request-&gt;get('_username');
              $password = $request-&gt;get('_password');
              if($username){
                  $user = $oem-&gt;getRepository('AdminEmployeeBundle:Employees')-&gt;loadUserByUsername($username);
                  if($user){
  
                      $dbpassword = $password;
                      if($dbpassword == $user-&gt;getPassword()){
                          // secured and redirect
                      $token = new UsernamePasswordToken($user,null,'main',array('ROLE_ADMIN'));
                      // give it to the security context
                      $this-&gt;container-&gt;get('security.context')-&gt;setToken($token);
                      return $this-&gt;redirect($this-&gt;generateUrl('_employeeList'));    
                  }
                      else{
                          $this-&gt;get('session')-&gt;setFlash('error','Please check username password');
                      }
                  }
              return $this-&gt;redirect($this-&gt;generateUrl('login'));    
              }
  </code></pre>
  
  <p>now i  want to use it in employee controller but i dont know that how to use it</p>