This is simple FastAPI that integrates Slack's OAuth2 for user authentication and authorization
-
Rename the .env.sample file to .env and add slack app client_id and client_secret
-
Create and activate virtualenv and run
pip install requirements.dev.txt
or Runpoetry init
andpoetry install --with dev
-
Run
docker-compose up -d --build
Slack only allows https redirects for it's OAuth redirect endpoint In testing the application ngrok was used.
-
Authorize endpoint {BASE_URL}/slack/oauth builds and return slack authorization url using the client_secret, client_id and the necessary scopes
-
Copy and past the url into a browser to authorize the app. This will call the post_authorize endpoint and returns acces_token, id_token and other information about the authorized user
-
Get users page endpoint {BASE_URL}/users return a paginated list of users
-
Get app_per_users {BASE_URL}/users/apps was partially implemented
-
Run enpoint {BASE_URL}/run returns aggregated results from get_app_per_user and get_users page
-
Verify endpoint {BASE_URL}/verify To test the verify endpoint, pass the access_token as an authorization header to the endpoint.