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

"Invalid JWT Signature." #9

Open
madc0w opened this issue Aug 17, 2017 · 0 comments
Open

"Invalid JWT Signature." #9

madc0w opened this issue Aug 17, 2017 · 0 comments

Comments

@madc0w
Copy link

madc0w commented Aug 17, 2017

I am trying to submit a sitemap.xml programmatically, following instructions here:
https://developers.google.com/webmaster-tools/search-console-api-original/v3/sitemaps/submit#auth

I do:

// Just call this once to set JWT
HTTPJWT.setJWTOptions({
	email : "[ client ID up to the first dot ]@developer.gserviceaccount.com",
	key : Assets.getText("key.pem"), // Get key file from assets
	scopes : [
		"https://www.googleapis.com/auth/webmasters"
	],
});

var submitUrl = "https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.spoticle.com/sitemaps/https%3A%2F%2Fwww.spoticle.com%2Fsitemap.xml";
var result = HTTPJWT.get(submitUrl);

... and here is the result:

Error: failed [400] { "error" : "invalid_grant", "error_description" : "Invalid JWT Signature." }

I can, however, generate a JWT by doing:

var jwt = GoogleOAuthJWT.encodeJWT({
	email : "[ client ID up to the first dot ]@developer.gserviceaccount.com",
	key : Assets.getText("key.pem"), // Get key file from assets
	scopes : [
		"https://www.googleapis.com/auth/webmasters"
	]
});

... but I don't know how to verify that this token is valid.

Any help appreciated. Thanks.

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

1 participant