Symfony2 login/logout response in json
A desktop application interacts with my website running on symfony2 and requires response in json, beginning with login success/failure. Using http_basic and providers if the login is correct everything works fine, but Im not able to send the json response. 
And if the login is incorrect it re-prompts the username and password dialog. How can I stop at the first failure attempt and send the json response 

    {
    'message':'invalid password/username'
    }

**security.yml**

     app:
                pattern:   ^/app.*
                logout: true 
                security: true
                http_basic:             
                  provider: webservice  
    providers:
            fos_userbundle:
                id: fos_user.user_manager
                
            webservice:
                id: my_provider

**config.yml**

    my_provider:      
            parent: doctrine.odm.mongodb.security.user.provider
            arguments: [ Se\PPBundle\Document\User, username]


**tl;dr** 
I want to respond with json on login.
Symfony2 login/logout response in json
===

A desktop application interacts with my website running on symfony2 and requires response in json, beginning with login success/failure. Using http_basic and providers if the login is correct everything works fine, but Im not able to send the json response. 
And if the login is incorrect it re-prompts the username and password dialog. How can I stop at the first failure attempt and send the json response 

    {
    'message':'invalid password/username'
    }

**security.yml**

     app:
                pattern:   ^/app.*
                logout: true 
                security: true
                http_basic:             
                  provider: webservice  
    providers:
            fos_userbundle:
                id: fos_user.user_manager
                
            webservice:
                id: my_provider

**config.yml**

    my_provider:      
            parent: doctrine.odm.mongodb.security.user.provider
            arguments: [ Se\PPBundle\Document\User, username]


**tl;dr** 
I want to respond with json on login.