How properly oauth2 works with background jobs #863
Unanswered
luifermoron
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
OAUTH - GOOGLE - CREDENTIALS ISSUE
I'm trying to add events using the Google API - OAUTH2.
There are 2 ways to do this:
👍 From the client side when the client gives permission to the APP, and also receives a code, then the event is created and everyone is happy.
👎 The error arises when I try to create it from a background job: that is, I do NOT have the code available. However, according to Google's documentation, it should be as easy as:
oauth2Client.setCredentials({
refresh_token:
STORED_REFRESH_TOKEN});
https://developers.google.com/identity/protocols/oauth2/web-server#creatingclient
I've already tried thousands of ways but in the end, I only committed the way that supposedly works for others to review and give me feedback. Thank you.
You can find the code in:
https://github.com/easyRS/easyRS/blob/ft-basic-auth/lib/drivers/network/googleapis.tsx#L73
The error message is also completely generic:
Beta Was this translation helpful? Give feedback.
All reactions