Skip to content
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

feat: support shorebird login --no-localhost for IDX #2431

Open
YunFeng-Huang opened this issue Aug 20, 2024 · 6 comments
Open

feat: support shorebird login --no-localhost for IDX #2431

YunFeng-Huang opened this issue Aug 20, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@YunFeng-Huang
Copy link

2024-08-20T15:15:35.687212 Choose an auth provider
2024-08-20T15:15:35.687521 Google
2024-08-20T15:15:35.726079 The Shorebird CLI needs your authorization to manage apps, releases, and patches on your behalf.

In a browser, visit this URL to log in:

https://accounts.google.com/o/oauth2/v2/auth?client_id=523302233293-eia5antm0tgvek240t46orctktiabrek.apps.googleusercontent.com&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A56926&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&code_challenge=p3vvxuIFw_rio6zKz-dNpEr6tzzRDMYL0hBCTD8PaSA&code_challenge_method=S256&state=o356JkM2dLQifeDBtplraS6FM2UrenK1

Waiting for your authorization...
2024-08-20T15:18:11.599404 ClientException with SocketException: Operation timed out (OS Error: Operation timed out, errno = 60), address = oauth2.googleapis.com, port = 57136, uri=https://oauth2.googleapis.com/token
2024-08-20T15:18:11.601627

@YunFeng-Huang YunFeng-Huang added the bug Something isn't working label Aug 20, 2024
@bryanoltman
Copy link
Contributor

Are you using Project IDX by any chance? shorebird login needs the ability to start a local http server so it can receive a callback from the authentication provider (Google, in this case). This does not work on Project IDX.

@eseidel
Copy link
Contributor

eseidel commented Oct 10, 2024

One thing we could do here is warn about reachability. e.g. from shorebird doctor or otherwise.

@eseidel eseidel added this to 1.1 Oct 10, 2024
@eseidel eseidel moved this to Customers in 1.1 Oct 10, 2024
@felangel
Copy link
Contributor

One thing we could do here is warn about reachability. e.g. from shorebird doctor or otherwise.

shorebird doctor does include api.shorebird.dev reachability (it was recently added).

@eseidel
Copy link
Contributor

eseidel commented Oct 10, 2024

In this case I think oauth2.google.com is the unreachable URL?

@eseidel
Copy link
Contributor

eseidel commented Oct 25, 2024

The real fix for these is to fall back to remote-based OAuth, like what Firebase does:

https://github.com/firebase/firebase-tools/blob/master/src/auth.ts#L543
https://github.com/firebase/firebase-tools/blob/master/src/auth.ts#L399

firebase login --no-localhost will also do this explicitly and is what IDX does.

@eseidel eseidel changed the title ClientException with SocketException: Operation timed out feat: support shorebird login --no-localhost for IDX Oct 25, 2024
@eseidel eseidel moved this from Customers to Next Big Feature in 1.1 Oct 25, 2024
@eseidel
Copy link
Contributor

eseidel commented Nov 4, 2024

This should be really easy to do on the command line side. The only real work is on the web side. I don't know exactly what auth.firebase.tools does.
https://github.com/firebase/firebase-tools/blob/ab05bb78f7fd5660394f97df150af322cf22f82f/src/api.ts#L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Next Big Feature
Development

No branches or pull requests

4 participants