djoos / EscapeWSSEAuthenticationBundle

Symfony bundle to implement WSSE authentication
http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html
137 stars 59 forks source link

unable to pass X-WSSE headers with request #47

Closed gr8light closed 10 years ago

gr8light commented 10 years ago

Hello,

I'm tring to get authenticated using api tokens with EscapeWSSEAuthenticationBundle. I can receive generated tokens at login but when I tried to send tokens back with another request, listener is not receiving headers I sent like X-WSSE and Authentication. here is the my jquery code I'm tring

jQuery.ajax ( {

  type: 'GET',
        dataType: "jsonp",
        url: this.apiUrl + req,
        //headers: JSON.stringify(this.token),
        beforeSend: function (xhrObj) {
            alert(that.token[1]);

            //xhr.withCredentials = true;
            xhrObj.setRequestHeader(
                    "HTTP-Authentication",'WSSE profile="UsernameToken"'
            );
            xhrObj.setRequestHeader("X-WSSE", "'"+that.token[1]+"'");

            //xhr.setRequestHeader('Access-Control-Allow-Origin', '*');             
        },
        success: function(response)
        {
            console.log(response);
            $('#responseBody').html(response);
        }
    });

could you pls. help me to fix this issue asap?

djoos commented 10 years ago

Hi gr8light,

I'd suggest you to try and get a straightforward example using cURL (or a wrapper around cUR, like requestcore) put together. Once you get that working, you can then port the logic to an async version...

Kind regards, David

djoos commented 10 years ago

Hi @gr8light,

please do have a look at #37 - perhaps writing some functional tests for your WSSE-secured API-call(s) will give you a solid base to build upon.

I'll close this issue for now as it is out of scope for the actual bundle, but don't hesitate to comment further on the closed issue so we can make sure to get you up and running!

Kind regards, David