Build your first Slack Bolt App Pt 3: OAuth & Storing User Credentials (w/ MongoDB)

Опубликовано: 23 Март 2025
на канале: Horea Porutiu
8,003
79

Code: https://github.com/horeaporutiu/oauth...

Bolt JS Framework code: https://slack.dev/bolt-js/concepts#au...

In this video, we walk thru OAuth logic on the Slack side and show how to implement it using Mogoose, node.js and MongoDB. This video assumes you've created a free MongoDB.

Part 1 of video:    • Build Your First Slack Bolt App: Sett...  
Part 2 of video:    • Build Your First Slack Bolt App Pt 2:...  

Timecodes
0:00 - Intro
0:42 - OAuth Diagram
0:58 - Admin Scopes OAuth flow
1:35 - When is storeInstallation called? (From Bolt JS framework)
2:02 - Non-Admin Scopes OAuth Flow
2:20 - When does fetchInstallation get called? (From Bolt JS framework)
2:42 - Bolt JS Code Review - https://slack.dev/bolt-js/concepts#au...
3:32 - GitHub Code - https://github.com/horeaporutiu/oauth...
3:54 - MongoDB setup
4:46 - Code walkthru - Custom Routes
5:02 - Code walkthru - app.js
5:40 - When does the OAuth flow trigger the auth code?
5:55 - Starting the app - npm start
6:10 - Understanding / setting env variables
6:38 - Use Ngrok to reach custom route (watch previous videos if you do not know what ngrok is)
6:56 - User credentials fetched after clicking "Allow" on Slack OAuth page
7:29 - Auth code - connecting to MongoDB
7:53 - Auth code - user credentials schema
8:22 - Auth code - fetching user credentials using "findUser"
8:45 - Auth code - storing user credentials - org & workspace install
9:49 - OAuth flow - org admin app install
10:17 - OAuth flow - reviewing org admin user credentials
10:49 - Auth code - saveUserOrgInstall (I MADE A MISTAKE IN THE VIDEO SORRY
10:56 - Reviewing User Credentials in MongoDB
11:12 - Conclusion