Closed jmaspons closed 1 year ago
I tried to make the authentication without the OAuth secret (see below), but it fails. So the secret is saved obfuscated.
library(osmapiR) #> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright token_url <- httr2::req_url_path( req = httr2::request(base_url = getOption("osmapir.base_auth_url")), "oauth2", "token" )$url client <- httr2::oauth_client( id = getOption("osmapir.oauth_id"), token_url = token_url, name = "osmapiR" ) auth_url <- httr2::req_url_path( req = httr2::request(base_url = getOption("osmapir.base_auth_url")), "oauth2", "authorize" )$url token <- httr2::oauth_flow_auth_code( client = client, auth_url = auth_url, scope = paste(c("read_prefs", "write_prefs", "write_api", "read_gpx", "write_gpx", "write_notes"), collapse = " "), pkce = TRUE, host_name = "127.0.0.1" ) #> Waiting for authentication in browser... #> Press Esc/Ctrl + C to abort #> Error in `oauth_flow_abort()`: #> ! OAuth failure [invalid_client] #> • Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method. #> Run `rlang::last_trace()` to see where the error occurred. token #> Error in eval(expr, envir, enclos): object 'token' not found logout_osmapi()
Seems that it should work without the secret https://github.com/openstreetmap/openstreetmap-website/issues/3494#issuecomment-1330487750
I tried to make the authentication without the OAuth secret (see below), but it fails. So the secret is saved obfuscated.