-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(auth): Support 2FA via browser window auth #654
base: main
Are you sure you want to change the base?
fix(auth): Support 2FA via browser window auth #654
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
369befe
to
4a5ffd9
Compare
0d27be5
to
a3768db
Compare
@afonsojramos do you have access to the Github App to add the redirect URI? |
@bmulholland can't we keep using the existing gitify.io/callback redirect URI? Why do we need a new one? |
@afonsojramos We need a way to get the information in the URL at the end of authentication to the app. Currently, this is done by controlling the browser itself, waiting until there's a redirect, and intercepting that event. If we open auth in an external browser, there isn't a way to monitor the event and intercept the page when auth is completed. Using a custom protocol is the usual way to get that data from the browser to an app, in lieu of intercepting events like that. So this is the standard approach. If we wanted to avoid adding a new redirect URI to the Github App, if we control gitify.io, we could perhaps add a redirect from that callback URI to our custom protocol, which would complete this flow. However, that wouldn't fix #429, and is also a genuine security hole: anyone with access to gitify.io could probably MITM the callback and get access to quite a lot of data. |
4a5ffd9
to
f0ec1cc
Compare
f0ec1cc
to
0fc4a21
Compare
a3768db
to
29fd59c
Compare
I'm working to remove the usage of electron remote, and Auth windows are the last one. They open the auth in a new window. Since Github has started enforcing 2FA for almost everyone, the electron-window auth approach isn't functional for most. It therefore doesn't make sense to spend work maintaining the existing broken auth; instead, we can switch to a new one.
This change moves auth to open in the default browser. When Auth is done, it will redirect to
gitify://oauth-callback
, which the app will register and monitor, finishing the auth process when it's done.At this point, I've got an initial approach started, but there's still lots to do. Help is welcomed.
There are several pieces left:
gitify://oauth-callback
redirect in the Github app settings -- do we have access to that?Fixes #561
Fixes #650
Fixes #429
Fixes #485
Closes #395