httr2库中的auth_code等效于fetch_token
我想复制 python 同时接收访问和刷新令牌的示例,例如(python)
token_response = oauth2_session.fetch_token(TOKEN_GRANT_URL, code=AUTHORIZATION_CODE, client_secret=CLIENT_SECRET)
我如何使用httr2
库来进行操作?
我之前的步骤要获得授权
(r),
client <- httr2::oauth_client(token_url = token_grant_url,secret = .app_secret,id = .app_key)
url_to_browse <- httr2::oauth_flow_auth_code_url(client=client, auth_url = auth_url,
scope = paste0(SCOPES_TO_REQUEST, collapse = " "),
redirect_uri = .client_redirect,state = STATE)
但我不明白我应该使用哪个功能,而不是fetch_token
感谢您的任何帮助您
还可以提供我离开我发行的链接 HTTR2
项目
I want to replicate python example of receiving both access and refresh tokens, like here (Python)
token_response = oauth2_session.fetch_token(TOKEN_GRANT_URL, code=AUTHORIZATION_CODE, client_secret=CLIENT_SECRET)
How could I do it using httr2
library?
There are my previous steps to get the AUTHORIZATION_CODE
(R)
client <- httr2::oauth_client(token_url = token_grant_url,secret = .app_secret,id = .app_key)
url_to_browse <- httr2::oauth_flow_auth_code_url(client=client, auth_url = auth_url,
scope = paste0(SCOPES_TO_REQUEST, collapse = " "),
redirect_uri = .client_redirect,state = STATE)
But I don't understand which function should I use instead of fetch_token
Thanks for any help you can provide
Also I leave the link of my issue from github page of httr2
project
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将使用
oauth2.0_token
函数( https”> https: //httr.r-lib.org/reference/oauth2.0_token.html )You would use the
oauth2.0_token
function (https://httr.r-lib.org/reference/oauth2.0_token.html)