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

encode_jwt_custom_url #25

Open
hhemul opened this issue Aug 16, 2016 · 3 comments
Open

encode_jwt_custom_url #25

hhemul opened this issue Aug 16, 2016 · 3 comments

Comments

@hhemul
Copy link

hhemul commented Aug 16, 2016

new option to encodeJWT required - url
because of using encodeJWT and requesting different url (such as https://www.googleapis.com/oauth2/v4/token) result in invalid grant error

diff --git a/lib/auth.js b/lib/auth.js
index 66bdc9d..52ea09a 100644
--- a/lib/auth.js
+++ b/lib/auth.js
@@ -92,7 +92,7 @@ exports.encodeJWT = function (options, callback) {
                claims = {
                        iss: options.email,
                        scope: options.scopes.join(' '),
-                       aud: GOOGLE_OAUTH2_URL,
+                       aud: options.url || GOOGLE_OAUTH2_URL,
                        exp: exp,
                        iat: iat
                };
@extrabacon
Copy link
Owner

Do you mind submitting this diff as a PR?

@hhemul
Copy link
Author

hhemul commented Aug 18, 2016

I would like to, but i haven't permissions to push new branch. At least i tried and not succeeded.

rainabba added a commit to rainabba/google-oauth-jwt that referenced this issue Jul 6, 2017
Apply the patch discussed at: extrabacon#25 (comment)
@rainabba
Copy link

rainabba commented Jul 6, 2017

PR submitted: #29

@hhemul You can cheat simple PR's like this on GitHub.com by using the edit icon for a given file. The rest of the PR process is guided and dead simple . I use this all the time for simple PR's.

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

3 participants