Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

FB_VERIFY_TOKEN is none when is already set in .env file #124

Open
LuisFerTR opened this issue Aug 21, 2020 · 12 comments
Open

FB_VERIFY_TOKEN is none when is already set in .env file #124

LuisFerTR opened this issue Aug 21, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@LuisFerTR
Copy link

Hi, I'm trying to setup the project but I have an issue checking webhook, when I execute

curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<YOUR VERIFY TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe&init_bot=true"

replacing <YOUR HOST> by localhost:5000 and <YOUR VERIFY TOKEN> by the string I wrote on .env file
I only receive "CHALLENGE_ACCEPTED", executing curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<YOUR VERIFY TOKEN>&init_bot=true"

returns an error stack finishing with this message: ValueError: FB_VERIFY_TOKEN does not match.
I've already set other variables in .env file but nothing seems to change. Is there anything I'm skipping?

@aboullaite
Copy link
Contributor

Hello, could you please mention what is your dev environment: OS? using docker or not ? ...
This will help us understand what the root issue.

@aboullaite aboullaite added the bug Something isn't working label Aug 21, 2020
@LuisFerTR
Copy link
Author

Sure, I tried in two different OS and didn't use docker in either of them,

  • Windows 10 Home, Python 3.7.5
  • Manjaro 20.0.3 KDE, Python 3.8.4

@elinguiuriel
Copy link
Contributor

@LuisFerTR make sure to update your URL to match what you define in .env

@vj-codes
Copy link
Contributor

vj-codes commented Sep 6, 2020

@LuisFerTR hey the token mentioned here is generated on the facebook page , you have just copy and paste that and it works fine.Do update if it isn't:)

@LuisFerTR
Copy link
Author

Oh I see, I'm a little lost, where can I get the token generated on the facebook page? I think it could be any string in the .env file and copy and paste in curl command.

@vj-codes
Copy link
Contributor

vj-codes commented Sep 6, 2020

@LuisFerTR see this part.
I followed the same and it worked:)

@LuisFerTR
Copy link
Author

I already have APP_ID, APP_SECRET, PAGE_ID and FB_PAGE_TOKEN, but I still missing FB_VERIFY_TOKEN, where can I find it?
I appreciate your help.

@vj-codes
Copy link
Contributor

vj-codes commented Sep 6, 2020

@LuisFerTR the verify token is the page_ access_token which is displayed next to the page_id . Generate that token, and add it to the . env file
I had set up it up locally long back so don't have any screen shots now
If you don't get it, I'll add the ss later:)

@LuisFerTR
Copy link
Author

LuisFerTR commented Sep 6, 2020

I'm here, I added access token as FB_VERIFY_TOKEN in my .env file, I'm still only getting "CHALLENGE ACCEPTED".
SS from where I took the access token:
https://drive.google.com/file/d/1ERw1VJ71Scqpio3Th4RVjG7_uUae7SMA/view?usp=sharing

@vj-codes
Copy link
Contributor

vj-codes commented Sep 7, 2020

@LuisFerTR although I don't understand the language but that's the correct ss
Where are you getting challenge accepted?

@LuisFerTR
Copy link
Author

LuisFerTR commented Sep 8, 2020

I'm sorry for not giving you a translation, I'm getting "challenge accepted" in the next instruction:

curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<FB_VERIFY_TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe&init_bot=true"

YOUR HOST is replaced with localhost:5000 and FB_VERIFY_TOKEN by the token in the ss, first I added the token in the ss in .env file in FB_VERIFY_TOKEN variable.

@vj-codes
Copy link
Contributor

vj-codes commented Sep 8, 2020

@LuisFerTR if you want to run the repo locally then just do pybabel compile -d locales and flask run make sure the app_url in .env is LocalTunnel .
This step can be ignored if your first goal is to run it successfully

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants