Not able to send mails using Nodemailer and access tokens obtained from GmailUse OAuth Refresh Token to Obtain New Access Token - Google APIHow to obtain access-token for a RAML API using OAuth 2.0Why is OAuth2 with Gmail Nodejs Nodemailer producing “Username and Password not accepted” errorGet Google access token expiration time in AndroidGet user access tokens and authenticate requestNodemailer XOauth2 [Error: unauthorized_client] when trying to get new access tokenTOAuth2Authenticator: How do i refresh an expired token?Gmail, nodemailer, OATH2 refresh token not workingGoogle OAuth 2 access token not working as expected some hours after authorizingHow to implement auto refresh token in graphql for jwt based authentication?
How long after the last departure shall the airport stay open for an emergency return?
Is Diceware more secure than a long passphrase?
How can I get rid of an unhelpful parallel branch when unpivoting a single row?
Mistake in years of experience in resume?
std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?
Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?
Why must Chinese maps be obfuscated?
Could moose/elk survive in the Amazon forest?
Is there any pythonic way to find average of specific tuple elements in array?
How to be good at coming up with counter example in Topology
Is there metaphorical meaning of "aus der Haft entlassen"?
Can a Bard use the Spell Glyph option of the Glyph of Warding spell and cast a known spell into the glyph?
How do I check if a string is entirely made of the same substring?
Von Neumann Extractor - Which bit is retained?
Is Electric Central Heating worth it if using Solar Panels?
Why do games have consumables?
What is this word supposed to be?
What does a straight horizontal line above a few notes, after a changed tempo mean?
Extracting Dirichlet series coefficients
How can I practically buy stocks?
Find a stone which is not the lightest one
What was Apollo 13's "Little Jolt" after MECO?
Why do distances seem to matter in the Foundation world?
Older movie/show about humans on derelict alien warship which refuels by passing through a star
Not able to send mails using Nodemailer and access tokens obtained from Gmail
Use OAuth Refresh Token to Obtain New Access Token - Google APIHow to obtain access-token for a RAML API using OAuth 2.0Why is OAuth2 with Gmail Nodejs Nodemailer producing “Username and Password not accepted” errorGet Google access token expiration time in AndroidGet user access tokens and authenticate requestNodemailer XOauth2 [Error: unauthorized_client] when trying to get new access tokenTOAuth2Authenticator: How do i refresh an expired token?Gmail, nodemailer, OATH2 refresh token not workingGoogle OAuth 2 access token not working as expected some hours after authorizingHow to implement auto refresh token in graphql for jwt based authentication?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
It works fine if I manually provide access tokens but those expire in 1 hour.
So, whenever I try to do one of the following :
- skip giving access token in createTransport function
- provide expired access token
- provide a expires value prior to current date
In each of the the above case I get an error 'unauthorized_client' with code: EAUTH, command: AUTH XOAUTH2
Simply, Nodemailer is not generating new access token but throwing errors.
I am providing the following while creating transport: type, user, clientId, clientSecret, refreshToken, accessToken and expires.
I have also tried providing authentication details in message options as given in 5th example here but that also doesn't works.
Please help me get out of this and thanks in advance.
node.js oauth-2.0 gmail-api google-oauth2 nodemailer
add a comment |
It works fine if I manually provide access tokens but those expire in 1 hour.
So, whenever I try to do one of the following :
- skip giving access token in createTransport function
- provide expired access token
- provide a expires value prior to current date
In each of the the above case I get an error 'unauthorized_client' with code: EAUTH, command: AUTH XOAUTH2
Simply, Nodemailer is not generating new access token but throwing errors.
I am providing the following while creating transport: type, user, clientId, clientSecret, refreshToken, accessToken and expires.
I have also tried providing authentication details in message options as given in 5th example here but that also doesn't works.
Please help me get out of this and thanks in advance.
node.js oauth-2.0 gmail-api google-oauth2 nodemailer
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55
add a comment |
It works fine if I manually provide access tokens but those expire in 1 hour.
So, whenever I try to do one of the following :
- skip giving access token in createTransport function
- provide expired access token
- provide a expires value prior to current date
In each of the the above case I get an error 'unauthorized_client' with code: EAUTH, command: AUTH XOAUTH2
Simply, Nodemailer is not generating new access token but throwing errors.
I am providing the following while creating transport: type, user, clientId, clientSecret, refreshToken, accessToken and expires.
I have also tried providing authentication details in message options as given in 5th example here but that also doesn't works.
Please help me get out of this and thanks in advance.
node.js oauth-2.0 gmail-api google-oauth2 nodemailer
It works fine if I manually provide access tokens but those expire in 1 hour.
So, whenever I try to do one of the following :
- skip giving access token in createTransport function
- provide expired access token
- provide a expires value prior to current date
In each of the the above case I get an error 'unauthorized_client' with code: EAUTH, command: AUTH XOAUTH2
Simply, Nodemailer is not generating new access token but throwing errors.
I am providing the following while creating transport: type, user, clientId, clientSecret, refreshToken, accessToken and expires.
I have also tried providing authentication details in message options as given in 5th example here but that also doesn't works.
Please help me get out of this and thanks in advance.
node.js oauth-2.0 gmail-api google-oauth2 nodemailer
node.js oauth-2.0 gmail-api google-oauth2 nodemailer
asked Mar 22 at 16:27
Ranveer SinghRanveer Singh
11
11
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55
add a comment |
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55303946%2fnot-able-to-send-mails-using-nodemailer-and-access-tokens-obtained-from-gmail%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55303946%2fnot-able-to-send-mails-using-nodemailer-and-access-tokens-obtained-from-gmail%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you please provide a sample of your code? Google's Using OAuth 2.0 for Web Server Applications documentation is really good and has a link to their Google APIs Node.js Client repo which has some useful code samples. Alternatively, you could look at Let less secure apps access your account which is simpler to implement but doesn't provide the same sort of robust options as OAuth2.
– ty2k
Mar 22 at 16:55