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

fix: set Content-Type header in the request to signBlob API to avoid Invalid JSON payload error #439

Merged
merged 8 commits into from Jul 30, 2020

Conversation

kimamula
Copy link
Contributor

@kimamula kimamula commented Feb 8, 2020

auth.create_custom_token() results in an error:

Failed to sign custom token. Error calling the IAM signBytes API:{ (...)
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"{\"bytesToSign\": \"...\"}\": Cannot bind query parameter. Field '{\"bytesToSign\": \"...\"}' could not be found in request message.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid JSON payload received. Unknown name \"{\"bytesToSign\": \"...\"}\": Cannot bind query parameter. Field '{\"bytesToSign\": \"...\"}' could not be found in request message."
          }
        ]
      }
    ]
  }
}

I have confirmed setting 'Content-Type': 'application/json' header resolves the problem.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 8, 2020
@kimamula kimamula force-pushed the fix-invalid-json-error branch 3 times, most recently from de6ba94 to 632808a Compare February 8, 2020 04:22
@kimamula
Copy link
Contributor Author

kimamula commented Feb 13, 2020

I think this is a serious bug which makes it impossible to create a custom token using a service account ID with Firebase Admin Python SDK.
The feature is crucial for our app which is to be released next week.
Please tell me if there is something I can do for this fix to be released.

@kimamula
Copy link
Contributor Author

I ended up using private key file.

tests/test_iam.py Outdated Show resolved Hide resolved
@tseaver tseaver added kokoro:force-run Add this label to force Kokoro to re-run the tests. automerge Merge the pull request once unit tests and other checks pass. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jul 21, 2020
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 21, 2020
@tseaver tseaver added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2020
@gcf-merge-on-green
Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, or one of your required reviews was not approved. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 22, 2020
@tseaver tseaver added automerge Merge the pull request once unit tests and other checks pass. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 30, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 30, 2020
@gcf-merge-on-green gcf-merge-on-green bot merged commit 20f82e2 into googleapis:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants