-
Notifications
You must be signed in to change notification settings - Fork 437
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
Update google api client to v25.x, enable code challenge/verifier #29
Conversation
…r improved oauth security
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the code challenge. A few nits.
let opts = { | ||
access_type: 'offline', | ||
scope: [ | ||
'https://www.googleapis.com/auth/script.deployments', | ||
'https://www.googleapis.com/auth/script.projects', | ||
], | ||
} | ||
code_challenge_method: 'S256', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include a link to:
https://developers.google.com/identity/protocols/OAuth2InstalledApp#step1-code-verifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
index.js
Outdated
}) | ||
}) | ||
.then(token => DOTFILE.RC.write(token)) | ||
authCode.then(code => oauth2Client.getToken({ code: code, codeVerifier: codes.codeVerifier })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Destructure when possible.
- Line too long
authCode.then(code => oauth2Client.getToken({
code,
codeVerifier: codes.codeVerifier
}))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
index.js
Outdated
@@ -442,7 +439,7 @@ program | |||
if (error) { | |||
logError(error, ERROR.CREATE); | |||
} else { | |||
let scriptId = res.scriptId; | |||
let scriptId = res.data.scriptId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please destructure data
here and elsewhere in the function callback above.
- script.projects.create({ title, parentId }, {}, (error, res) => {
+ script.projects.create({ title, parentId }, {}, (error, {data}) => {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Updated |
Thanks! Will push to |
See https://developers.google.com/identity/protocols/OAuth2InstalledApp#step1-code-verifier for details about the protocol change.