title: how to login in symfony with an external post call that return a json with a status
body: <p>login in symfony with an external post call that return a json</p>
  
  <pre><code> &lt;form class="form-signin" action="example.com/user/login"method="post"&gt;
  
  
                   {% if is_granted('ROLE_APP') %}
                    You are logged 
                   {% else %}
                   You are not logged !
                   {% endif %}
  
  
     &lt;label for="inputEmail" class="sr-only"&gt;Username&lt;/label&gt;
     &lt;input type="text" name="username" class="form-control" placeholder="username" required autofocus&gt;
     &lt;label for="inputPassword" class="sr-only"&gt;Password&lt;/label&gt;
  
  
     &lt;input type="password" name="password" class="form-control" placeholder="password" required&gt;
  
  
   &lt;button class="btn btn-lg btn-primary btn-block" type="submit"&gt;Sign in&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>if a call the external api return the json correct but how can i set the role of the user that in json return with ok?</p>
  
  <p>thanks</p>