I get this error when a user attempts to log in via facebook. My application uses express.
FacebookTokenError: Error validating client secret.
at Strategy.parseErrorResponse (/pathtomyapp/node_modules/passport-facebook/lib/strategy.js:198:12)
at Strategy.OAuth2Strategy._createOAuthError (/pathtomyapp/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:345:16)
at /pathtomyapp/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:171:43
at /pathtomyapp/node_modules/passport-facebook/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:177:18
at passBackControl (/pathtomyapp/node_modules/passport-facebook/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:124:9)
at IncomingMessage.<anonymous> (/pathtomyapp/node_modules/passport-facebook/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:143:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
What is causing this? How do I fix it?
FacebookTokenError: Error validating client secret.
I got that error when I ran my code. I check my App_ID and App_SECRET and I found that I write the ";" at the end of my sentence and I got it. So If you got that Error, you have to check you code again and run it.
I ran into the same issue and was pulling my hair out over it. The fix is very simple. Make sure that your clientID and clientSecret are both valid (and different)! A copying error in my config file led to both being the same and I got your stack trace. If that doesn't solve the problem, you can add logging into the passport-facebook modules to see more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With