# create fake tokens
token_a <- httr2::oauth_token("1234", arcgis_host = arc_host())
token_b <- httr2::oauth_token("abcd", arcgis_host = arc_host())
# set token to the default location
set_arc_token(token_a)
# fetch token from the default location
arc_token()
# set token by name
set_arc_token(org_a = token_a, org_b = token_b)
# fetch token by name
arc_token("org_a")
arc_token("org_b")
# unset tokens
unset_arc_token()
unset_arc_token(c("org_a", "org_b"))
Run the code above in your browser using DataLab