Skip to content

Cannot publish to pub.dartlang #36039

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

Closed
renatoathaydes opened this issue Feb 26, 2019 · 5 comments
Closed

Cannot publish to pub.dartlang #36039

renatoathaydes opened this issue Feb 26, 2019 · 5 comments

Comments

@renatoathaydes
Copy link

  • Dart SDK Version (dart --version)

Dart VM version: 2.1.1 (Unknown timestamp) on "linux_x64"

  • Whether you are using Windows, MacOSX, or Linux (if applicable)

#165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018

  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable)

Chrome and Firefox tried.

Description:

Running pub publish I get this message:

Looks great! Are you ready to upload your package (y/n)? y
Pub needs your authorization to upload packages on your behalf.
In a web browser, go to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A45216&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
Then click "Allow access".

Waiting for your authorization...

When I follow the link in the browser, I see a 400 error message.

400. That’s an error.

Error: invalid_request

Missing required parameter: redirect_uri

Learn more
Request Details

    access_type=offline
    approval_prompt=force
    response_type=code
    client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent

That’s all we know.
@renatoathaydes
Copy link
Author

I've tried adding a few OAuth parameters that were missing... still no luck:

401. That’s an error.

Error: invalid_client

The OAuth client was not found.
Request Details

    access_type=offline
    approval_prompt=force
    response_type=code
    client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent
    redirect_uri=https://pub.dartlang.com
    scope=profile

That’s all we know.

@renatoathaydes
Copy link
Author

I've upgraded to Dart 2.2.0, pub --version shows 2.2.0 as well... still same problem. The OAuth client used by pub seems to be misconfigured.

@natebosch
Copy link
Member

cc @jonasfj

@jonasfj
Copy link
Member

jonasfj commented Feb 27, 2019

@renatoathaydes, can you please double check that you copied the entire URL from your terminal to the browser...

If I open https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A45216&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
in my browser (I probably shouldn't let myself get phished that easily 🙈)..

I can sign-in without problems... but upon gettting redirect to http://localhost:45216/?code=.... the browser will obviously get an error as the pub client on my machine is not listening to port 45216 and waiting for a call back...

Note. it's easy to only copy part of the URL out of the terminal. It's a little unfortunate that the URL is so long..

@renatoathaydes
Copy link
Author

@jonasfj you're right... my terminal in IntelliJ highlights the link so I just clicked on it, didn't copy... but unfortunately the terminal didn't highlight the full URL.
Sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants