FacebookTokenError: Error validating client secret
Asked Answered
G

3

8

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?

Garrity answered 22/6, 2014 at 19:53 Comment(1)
do you found any solution? I have the same issuePrine
H
8

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.

Halda answered 2/9, 2014 at 10:55 Comment(1)
Also worth noting that it is not that the Client Token, Client Secret, and Client Id are all different things. We had swapped some and ran into this issue.Planish
S
1

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.

Stereotomy answered 16/8, 2020 at 11:49 Comment(0)
M
0

Please make sure that you've copied correct app id (not client token) and app secret id. Client token is NOT the app secret id. For correct App Secret and App Id, go to Settings -> Basic -> App id/secret.

Maul answered 19/6, 2022 at 18:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.