~/talk

Building an OAuth Flow in a Node.js CLI

Talkat iJS London 2019 · 2019-05-13..05-15· [nodejs, security]
links:none on file
slides:none on file

Builds a working three‑legged OAuth2 authorization_code flow inside a Node CLI, using readline for the shell, fs-extra to persist tokens in a hidden JSON, and the Dropbox SDK plus HTTP.createServer to catch the callback. Shows that Express struggled so native HTTP is used, the access token is issued without a refresh token (long‑lived), curl and API calls list folders to verify success, and stored tokens are read, validated and deleted as needed.

AI-written summary · about

  1. 0:00Introduction
  2. 1:18Overview
  3. 2:02Seattle
  4. 2:36Dont take yourself too seriously
  5. 2:53The API economy
  6. 3:29The theoretical app
  7. 4:22OAuth
  8. 7:19Consent Screen
  9. 7:31Scopes
  10. 7:59Scopes Explained
  11. 8:52Actors Explained
  12. 9:21OAuth Tokens Explained
  13. 10:19Authorization Server Explained
  14. 11:02OAuth Flows
  15. 11:58Threelegged OAuth Flow
  16. 13:32Requesting Authorization
  17. 16:34Requesting Access Token
  18. 18:58Calling API
  19. 20:51What is a CLI
  20. 21:16CLI frameworks
  21. 22:59Readline
  22. 24:44Token Storage
  23. 27:56Using a stored token
  24. 33:08Application overview
  25. 33:23Code overview
  26. 35:26Get OAuth token
  27. 37:17Redirect response
  28. 38:03Authorization URL
  29. 40:08OAuth token
  30. 43:40Wrap up
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.