k-paxian / dart-package-publisher

Action to Publish Dart / Flutter Package To https://pub.dev When you need to publish a package, just bump the version in pubspec.yaml
MIT License
66 stars 10 forks source link

`Pub needs your authorization to upload packages on your behalf.` for non-verified publisher #14

Closed sitaram-kalluri closed 3 years ago

sitaram-kalluri commented 3 years ago

While publishing the package to the pub.dev, the dry-runs successfully. But when trying to publishing the package, it returns a link that says to 'In the web browser paste the link and click on Allow access', When pasted the link in a web browser, it returns unable to connect.

Tried by

  1. Adding content in credentials.json in .pub-cached to secrets.CREDENTIAL_JSON variable.
  2. Adding accessToken and refreshToken

Attaching the screenshot below. image1 image2

Appreciate any help that unblocks me. Thank you.

k-paxian commented 3 years ago

please show me the action running full log, it's obviously looks like a bad credentials supplied

sitaram-kalluri commented 3 years ago

I believe the credentials are correct because the dry-run was successful. Attaching the complete logs, please take a look and correct me if something is incorrectly configured.

Link to GitHub actions file: https://github.com/kalluriramkumar/yaml-formatter/blob/master/.github/workflows/yaml-formatter-publish.yaml Complete Logs: logs_12.zip

davidzhao commented 3 years ago

I'm experiencing this as well. Oauth access key / secret key have been provided.

Dart SDK 2.13.4
Flutter SDK 2.2.3
M123-dev commented 3 years ago

I think it is not even a problem of this package but a security feature of pub.dev cf: https://github.com/dart-lang/pub-dev/issues/4910

M123-dev commented 3 years ago

We did some further investigations and we noticed the the credentials.json also contained a idToken which is not considered in this action. To counter this we have gone from passing the individual keys to passing the whole credentials.json but this also lead to a authentication request.

The workflow: https://github.com/openfoodfacts/openfoodfacts-dart/blob/release-test-2/.github/workflows/release.yml#L54 The log: https://github.com/openfoodfacts/openfoodfacts-dart/runs/4039822795?check_suite_focus=true

@k-paxian on your published packages, it looks like the workflow is still working. Do you have any ideas what the problem could be?

k-paxian commented 3 years ago

Wonderful! I think I've got an answer to this issue 🥳

Use case 1: 🟢 https://github.com/microsoft/fluentui-system-icons image log: https://github.com/microsoft/fluentui-system-icons/runs/4041194807?check_suite_focus=true#step:16:242

Use case 2: 💚 https://github.com/k-paxian/dart-json-mapper image log: https://github.com/k-paxian/dart-json-mapper/runs/3920379817?check_suite_focus=true#step:6:92

Use case 3: 🔴 https://pub.dev/packages/yaml_formatter image

Use case 4: 🔴 https://pub.dev/packages/openfoodfacts image

The answer is obvious No? 😄 Go ahead and make it happen if you own some domain, you can resolve the issue

@M123-dev Thank you for asking right question! I'll update the readme to reflect that fact