Unable to authenticate from javascript


#1

Hi,
I have tried many times to authenticate using oauth. following is the code from javascript. It will get status 0 in error callback after making ajax call.
Please help me… it is urgent.

:: Twitter Login :: function GetTwitter() { $.ajax({ type: "POST", url: "https://api.twitter.com/oauth/request_token", beforeSend: SetHeaders, success: function (msg) { alert(msg); }, error: function (xhr) { alert("An error occured : " + xhr.status + " " + xhr.statusText); } }); }
    function SetHeaders(xhr) {
        xhr.setRequestHeader("oauth_callback", "http://localhost/wwm/default2.asp");
        xhr.setRequestHeader("oauth_consumer_key", "UYXhGdMgUG4mx9Fq6Ztjw");
        xhr.setRequestHeader("oauth_nonce", "QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk");
        xhr.setRequestHeader("oauth_signature_method", "HMAC-SHA1");
        xhr.setRequestHeader("oauth_signature", encodeURI("gSuISr7V9wFHQTcpidzdzwGwSiFamDCug7nAHs3pMeE"));
        xhr.setRequestHeader("oauth_timestamp", "1272323042");
        xhr.setRequestHeader("oauth_version", "1.0");
    }
</script>

#2

OAuth 1.0A is not allowed on Twitter through client-side Javascript. If you want to implement a client-side solution, I recommend using our [node:183] instead. Otherwise, a server-side integration may be a better bet.


#3

Is there any particular reason that Javascript-sent OAuth 1.0A is not allowed on Twitter? I understand that Javascript is not secure in terms of hiding the consumer key/secret, but I’m simply using it to send an HTTP request for authentication. I suppose a more specific question: is client-side Javascript incompatible with the way that Twitter accepts OAuth requests or does Twitter actively block requests made with Javascript?

Thanks.


#4

Web Intents Supported Parameters text how to with image??


#5

How to generate oauth_nonce , oauth_signature ?


#6

how to sign up with twitter in JavaScript


#7

this code is not working … it not autenticate twitter account…

so plz tell me how to sign in with in twitter in javascript


#8

send an HTTP request for authentication. I suppose a more specific question: is client-side Javascript incompatible with the way that Twitter accepts OAuth requests or does Twitter actively block requests made with Javascript?


#9

HTML