Oauth Error Validating Client Secret
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have error validating client secret facebook Meta Discuss the workings and policies of this site About Us facebooktokenerror: error validating client secret. Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with graph returned an error: error validating client secret. us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
Fbtrace_id
like you, helping each other. Join them; it only takes a minute: Sign up “Error validating client secret.” 404 with Facebook Oauth and ruby up vote 7 down vote favorite 1 I am trying to implement facebook authentication for an app with warden, after the user allows facebook auth and redirects to my app callback with developers facebook the token I get a 400 while consuming the api. My warden strategy is this: class Facebook < Warden::Strategies::Base def client @client ||= OAuth2::Client.new MyApp::Facebook::AppID, MyApp::Facebook::AppSecret, :site => 'https://graph.facebook.com' end def params @params ||= Rack::Utils.parse_query(request.query_string) end def authorize_url client.web_server.authorize_url :redirect_uri => request.url, :scope => 'email,publish_stream' end def authenticate! throw(:halt, [302, {'Location' => authorize_url}, []]) unless params['code'] facebook = client.web_server.get_access_token params['code'], :redirect_uri => request.url rescue OAuth2::HTTPError => e puts e.response.body end end Strategies.add :facebook, Facebook The result of printing the response body is this: {"error":{"type":"OAuthException","message":"Error validating client secret."}} I am pretty shure the app id and app secret are the ones provided by FB. Thanks. ruby facebook oauth-2.0 share|improve this question asked Jan 20 '11 at 23:00 Macario 1,3161429 add a comment| 1 Answer 1 active oldest votes up vote 13 down vote accepted I've seen that error message many times. Here are the things I would double check: your domain is the same as what you listed in the facebook callback url the app id is correct
Sign in Pricing Blog Support Search GitHub This repository Watch 214 Star 1,357 Fork 727 facebook/php-graph-sdk Code Issues 20 Pull requests 8 Projects 0 Pulse Graphs New issue Graph error validating client secret #538 Closed zorow opened this Issue Dec 2, 2015 · 10 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 5 participants zorow commented Dec 2, 2015 Im trying to http://stackoverflow.com/questions/4753643/error-validating-client-secret-404-with-facebook-oauth-and-ruby implement the facebook login via the php sdk ive set the correct appid and app secret and also in the dashboard ive set the correct appdomain and site url yet still it cant give me an access token kindly assist SammyK commented Dec 2, 2015 Can you post any relevant errors and snippets of https://github.com/facebook/php-graph-sdk/issues/538 code that are causing the error? zorow commented Dec 3, 2015 in accessing the access token is the place the error get generated and im sure ive triple checked the client secret for validity try { $accessToken = $helper->getAccessToken(); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getRawResponse(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } xero88 commented Dec 3, 2015 Hi, What are the returned error ? zorow commented Dec 3, 2015 it says Graph error: couldn't verify client secret zorow commented Dec 3, 2015 This is the exact messge Graph returned an error: {"error":{"message":"Error validating client secret.","type":"OAuthException","code":1,"fbtrace_id":"F0n\/KYH+Z5K"}} gfosco commented Dec 8, 2015 You're sure you're setting the app_secret param when creating the Facebook instance? zorow commented Jan 31, 2016 yeah its giving me this error raph returned an error: {"error":{"message":"Error validating client secret.","ty
validating verification code." } } I was following the guides at Facebook Developers to do OAuth on the server side. In summary: Redirect the user to https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL After user click allow, it’ll hit our http://www.ronaldwidha.net/2011/03/24/facebook-oauth-access_token-return-http-400-error-validating-verification-code/ Redirect Uri At that point we’ll get the code and we need to do a server side HTTP Get to the following Url to exchange the code with our oAuth access token: https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL& client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE Now at step 3, I kept on getting Http 400 response back. So after some research, I found out that on that redirect_uri that we submitted on error validating step 3 doesn’t do anything but validate the request. Thus, the value need to match with step 2. Finally! Phew. Ronald Widha Ronald Widha is a Digital Strategist and a podcast addict. He loves all things disruptive and a cool hunter. Currently living in NY. Related Articles | errorfacebookOAuth 11 thoughts on “Facebook OAuth access_token return HTTP 400 Error Validating Verification Code” Aleksandr says: March 29, error validating client 2011 at 7:48 am I've seen this fucking expample for about 1000 times. Please send me something else. How to authenticate, get access_tocken and send message to wall? Mcbodo says: July 27, 2011 at 4:15 pm This post was a really life saver. I spent the last 2 days trying to understando why it wasn't working! 😀 ronaldwidha says: July 28, 2011 at 1:04 am glad that I could help Amitzu89 says: October 26, 2011 at 3:27 pm Thanks Dude!!! It saved ma day 😉 Michal says: February 28, 2012 at 4:22 am Thanks man 🙂 cooldriver says: April 17, 2012 at 3:22 am Thanks a lot man 🙂 Hugodemiglio says: April 24, 2012 at 1:50 pm Thanks a lot!! =D Poulsq says: June 6, 2012 at 5:19 am Ok, i have to tell thank you, because this f*cking facebook api make me crazy for such a little problem … Thanks man ! deype0 says: September 15, 2012 at 10:31 am Thanks! bob says: November 8, 2012 at 7:01 pm You have saved countless lives. Roland Krinner says: October 14, 2014 at 2:06 pm Thanks a lot, you saved my day! Comments are closed.