r Gmail如何在囊胚安装后重建原始OAuth

r Gmail如何在囊胚安装后重建原始OAuth,r,oauth,gmail,google-oauth,gmailr,R,Oauth,Gmail,Google Oauth,Gmailr,我用Gmail成功地配置了oauth,下面的代码运行正常 require(gmailr) gm_auth_configure(path="E:/SOME_NAME.json") test_email <- mime( To = "someone@something.com", From = "someone@gmail.com", Subject = "this is just a gmailr test", body = "Can you hear me now?") gm_send

我用Gmail成功地配置了oauth,下面的代码运行正常

require(gmailr)

gm_auth_configure(path="E:/SOME_NAME.json")

test_email <- mime(
To = "someone@something.com",
From = "someone@gmail.com",
Subject = "this is just a gmailr test",
body = "Can you hear me now?")
gm_send_message(test_email)
现在当我跑步时:

require(gmailr)
gm_auth_configure(path="E:/SOME_NAME.json")
test_email <- mime(
To = "someone@somewhere.com",
From = "someone@gmail.com",
Subject = "this is just a gmailr test",
body = "Can you hear me now?")
gm_send_message(test_email)
require(Gmail)
gm\u auth\u configure(path=“E:/SOME\u NAME.json”)

test_email我找到了如何重置回原始誓言文件的方法,gm_auth(cache=“.secret”)实现了这一点。现在,这会将您带回google页面,链接回原始oauth文件,之后一切都会恢复正常。因此,完整的代码是:

gm_auth_configure(path="E:/SOME_NAME.json")
gm_auth(cache=".secret")

test_email <- mime(
To = "someone@something.com",
From = "someone@gmail.com",
Subject = "this is just a gmailr test",
body = "Can you hear me now?")
gm_send_message(test_email)
gm\u auth\u configure(path=“E:/SOME\u NAME.json”)
gm_认证(缓存=“.secret”)

test_email invalid_grant通常表示您发送的令牌无效或过期。感谢DalmTo的评论。我在Gmail中使用的原始誓言文件仍然有效,问题是blastula中的誓言文件位置将身份验证指向了错误的位置。添加gm_auth(cache=“.secret”)将重置誓言,并带您再次通过谷歌的身份验证,现在一切正常。
gm_auth_configure(path="E:/SOME_NAME.json")
gm_auth(cache=".secret")

test_email <- mime(
To = "someone@something.com",
From = "someone@gmail.com",
Subject = "this is just a gmailr test",
body = "Can you hear me now?")
gm_send_message(test_email)