Helper function to use httr's OAuth2.0 functions non-interactively, e.g. in test cases
Source:R/oauth.R
oauth2_httr_login.Rd
To perform an automatic acknowledgement and log in for a
local OAuth2.0 app, run by httr, wrap the expression that
obtains the OAuth2.0 token in oauth2_httr_login()
.
Arguments
- expr
Expression that calls
httr::oauth2.0_token()
, either directly, or indirectly.
Details
In interactive sessions, oauth2_httr_login()
overrides the
browser
option, and when httr opens a browser page, it
calls oauth2_login()
in a subprocess.
In non-interactive sessions, httr does not open a browser page,
only messages the user to do it manually. oauth2_httr_login()
listens for these messages, and calls oauth2_login()
in a
subprocess.
See also
See ?vignette("oauth", package = "webfakes")
for a case
study that uses this function.
Other OAuth2.0 functions:
oauth2_login()
,
oauth2_resource_app()
,
oauth2_third_party_app()