Set up as follows:
Install virtualenvwrapper
if it isn't already installed:
pip install virtualenvwrapper
Create a virtualenv, using python 3:
mkvirtualenv --python $(which python3) flask-oauth
Install the requirements:
pip install -r requirements.txt
Set up your Slack application:
https://api.slack.com/docs/sign-in-with-slack
If needed, use ngrok to create a tunnel (and public https url) to your local app.
Save the python file below as runme.py
and run it like this:
FLASK_APP=runme.py FLASK_DEBUG=1 flask run -p 8880
The python code refers to github throughout because it was stolen from a github example at https://github.com/lepture/flask-oauthlib/tree/master/example But it does not use github at all, it tries to use Slack.
It does not currently work. What is the secret sauce to make it work?
Probably a little late here but I was using this as a ref and realized that you don't need the initial auth call if you're using the Sign in with Slack button because the Sign in Button does that part (I noticed it was making two requests) - i.e. just set
/login/authorized
as your callback url. Re. your error you can get what you need out of the response, e.g.me = resp['user']