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

Private Key Signing vs Signing from Service Account file #310

Closed
deepanshug opened this issue Sep 26, 2023 · 5 comments
Closed

Private Key Signing vs Signing from Service Account file #310

deepanshug opened this issue Sep 26, 2023 · 5 comments

Comments

@deepanshug
Copy link

What's your question?

Invalid Signature when using RSA 256 sign

Additional Context

Hi, I used your library for a particular use case to generate JWT token for google APIs.
To access google APIs, I am using service account which gives me key.json file with private key in it.

I tried to use this private key mentioned in key.json file and used as below
".sign(jwt::algorithm::rs256("", rsa_priv_key, "", ""));" where rsa_priv_key contains value from key.json file.

My question is: is there any way that I can pass this key.json file to sign?

@deepanshug
Copy link
Author

In short, signing by openssl throws Invalid JWT SIgnature error while signing bu google.auth.crypt package (in python) generates a valid one that gives me access token

@deepanshug
Copy link
Author

Please help

@prince-chrismc
Copy link
Collaborator

Please refer to Google's documentation about how to use their JWT. Looking at https://googleapis.dev/python/google-auth/latest/reference/google.auth.crypt.html you'll need to implment whatever logic that is doing under the hood.

There are old issues around this, you should do some research on this topic #282 #271 (comment) you are probably going to need #146 :)

@prince-chrismc
Copy link
Collaborator

I am going to mark this as closed since it's related to how to using Google not the library, please feel free to open a new issue with any specific technical questions about the library :)

@prince-chrismc prince-chrismc closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2023
@deepanshug
Copy link
Author

I agree, thanks for closing.

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

No branches or pull requests

2 participants