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
You would use the
oauth2.0_tokenfunction (https://httr.r-lib.org/reference/oauth2.0_token.html)