{"id":7526,"date":"2015-07-18T03:34:05","date_gmt":"2015-07-18T03:34:05","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/07\/18\/angularjs-satellizer-twitter-login-cors-error-on-redirect-open-source-projects-sahat-satellizer\/"},"modified":"2022-08-30T15:45:34","modified_gmt":"2022-08-30T15:45:34","slug":"angularjs-satellizer-twitter-login-cors-error-on-redirect-open-source-projects-sahat-satellizer","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/07\/18\/angularjs-satellizer-twitter-login-cors-error-on-redirect-open-source-projects-sahat-satellizer\/","title":{"rendered":"Angularjs Satellizer Twitter login CORS error on redirect-open source projects sahat\/satellizer"},"content":{"rendered":"<p>I&#8217;m trying to implement a login with satellizer for twitter. I&#8217;m following the examples on the satellizer repository, so on client-side i do the following:<\/p>\n<pre><code>$auth.authenticate('twitter')\n     .then(function (res) {\n           console.log(res);\n     });\n<\/code><\/pre>\n<p>And on server-side i follow their login flow for oauth 1.0:<\/p>\n<pre><code>Client: Open a popup window via $auth.authenticate('provider name').\nClient: Unlike OAuth 2.0, you cannot go directly to the authentication screen without a valid request token.\nClient: The OAuth 1.0 flow starts with the GET request to \/auth\/provider inside the popup.\nServer: Check if URL contains oauth_token and oauth_verifier parameters.\nSever: Initially it does not, so send an OAuth signed POST request to the \/request_token URL.\nServer: Redirect to the \/authenticate URL with a valid request token.\n<\/code><\/pre>\n<p>But, when i get to redirect to the \/authenticate URL i get a CORS error:<\/p>\n<pre><code>No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.\n<\/code><\/pre>\n<p>I looked on their example for php\/Laravel and they use redirect, but for me is not working.<\/p>\n<p>How can i solve this problem?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to implement a login with satellizer for twitter. I&#8217;m following the examples on the satellizer repository, so on client-side i do the following: $auth.authenticate(&#8216;twitter&#8217;) .then(function (res) { console.log(res); }); And on server-side i follow their login flow for oauth 1.0: Client: Open a popup window via $auth.authenticate(&#8216;provider name&#8217;). Client: Unlike OAuth 2.0, you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-7526","post","type-post","status-publish","format-standard","hentry","category-laravel","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7526"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7526\/revisions"}],"predecessor-version":[{"id":8850,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7526\/revisions\/8850"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}