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

idtoken Validate giving crypto/rsa: verification error #2053

Open
J-Nokwal opened this issue Jul 5, 2023 · 1 comment
Open

idtoken Validate giving crypto/rsa: verification error #2053

J-Nokwal opened this issue Jul 5, 2023 · 1 comment
Assignees
Labels
needs more info This issue needs more information from the customer to proceed. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@J-Nokwal
Copy link

J-Nokwal commented Jul 5, 2023

getting error(*errors.errorString) *{s: "crypto/rsa: verification error"} error for this code below can any one help me please

payload, err := idtoken.Validate(context.Background(), idToken, audience)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Print(payload.Claims)
@J-Nokwal J-Nokwal added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Jul 5, 2023
@codyoss codyoss assigned quartzmo and noahdietz and unassigned codyoss and quartzmo Jul 6, 2023
@noahdietz
Copy link
Contributor

So "crypto/rsa: verification error" likely came from the HTTPS requests made to pull down the Google public certs for verification

certResp, err := v.client.getCert(ctx, googleSACertsURL)
. This could be from your system root certs being out of date - pulling the Google certs uses the default Go client.

Or, probably more likely, it came from the actual verification of the id token you provided it, from here

return rsa.VerifyPKCS1v15(pk, crypto.SHA256, hashedContent, sig)

It is an intentionally vague error so you will have to do some debugging. Not much more I can do without extra logs.

@noahdietz noahdietz added the needs more info This issue needs more information from the customer to proceed. label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs more information from the customer to proceed. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants