mootari / observable-client

MIT License
14 stars 6 forks source link

Authentication fails #2

Closed Fil closed 4 years ago

Fil commented 4 years ago

log:

cd /Users/fil/Source/observable/backup && /usr/local/bin/node api.js backup-user fil
T=11111111111111redacted00; Domain=observablehq.com; Path=/; Expires=Sat, 15 Aug 2020 19:23:54 GMT; Secure
(node:93053) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
Please enter github username:fil
Please enter github password:*****
Please enter 2FA:111141
failed to authenticate!

( I deleted ./node_modules/flat-cache/.cache/cacheId )

mootari commented 4 years ago

Notes: Github authorization needs to be rewritten. There's no need to construct the auth URL ourselves. Instead we need to post to https://api.observablehq.com/login, passing the following data:

token: {csrf token}
path: /loggedin/
login: {username}

The response will be a 302 redirect to the Github auth URL (or whatever service the user registered with).

mootari commented 4 years ago

I managed to handle the Observable side, but the Github forms seem to need some adjusting. Might continue looking into it tomorrow.

mootari commented 4 years ago

@Fil Are you using 2FA?

Fil commented 4 years ago

Yes

Le sam. 15 août 2020 à 16:15, Fabian Iwand notifications@github.com a écrit :

@Fil https://github.com/Fil Are you using 2FA?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mootari/observable-client/issues/2#issuecomment-674403630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABWWKNLYGKF7S37M3T5HDSA2J7JANCNFSM4P6YSOGQ .

-- -- Fil

mootari commented 4 years ago

@Fil mind giving #3 a try?