Skip to content

Commit fc1f201

Browse files
committed
Create a fake oauth credentials file
Requested by CRAN
1 parent a4ea2ff commit fc1f201

File tree

3 files changed

+40
-18
lines changed

3 files changed

+40
-18
lines changed

R/sheets_auth.R

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,26 @@ sheets_has_token <- function() {
157157
#' # bring your own app via client id (aka key) and secret
158158
#' google_app <- httr::oauth_app(
159159
#' "my-awesome-google-api-wrapping-package",
160-
#' key = "123456789.apps.googleusercontent.com",
161-
#' secret = "abcdefghijklmnopqrstuvwxyz"
160+
#' key = "YOUR_CLIENT_ID_GOES_HERE",
161+
#' secret = "YOUR_SECRET_GOES_HERE"
162162
#' )
163-
#' google_key <- "the-key-I-got-for-a-google-API"
163+
#' google_key <- "YOUR_API_KEY"
164164
#' sheets_auth_configure(app = google_app, api_key = google_key)
165165
#'
166166
#' # confirm the changes
167167
#' sheets_oauth_app()
168168
#' sheets_api_key()
169-
#' }
170169
#'
171-
#' \dontrun{
172-
#' ## bring your own app via JSON downloaded from Google Developers Console
173-
#' sheets_auth_configure(
174-
#' path = "/path/to/the/JSON/you/downloaded/from/google/dev/console.json"
175-
#' )
170+
#' # bring your own app via JSON downloaded from Google Developers Console
171+
#' # this file has the same structure as the JSON from Google
172+
#' app_path <- system.file(
173+
#' "extdata", "fake-oauth-client-id-and-secret.json",
174+
#' package = "googlesheets4"
175+
#' )
176+
#' sheets_auth_configure(path =app_path)
177+
#'
178+
#' # confirm the changes
179+
#' sheets_oauth_app()
176180
#' }
177181
#'
178182
#' # restore original auth config
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"installed": {
3+
"client_id": "YOUR_CLIENT_ID_GOES_HERE",
4+
"project_id": "YOUR_PROJECT_ID_GOES_HERE",
5+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
6+
"token_uri": "https://oauth2.googleapis.com/token",
7+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
8+
"client_secret": "YOUR_SECRET_GOES_HERE",
9+
"redirect_uris": [
10+
"urn:ietf:wg:oauth:2.0:oob",
11+
"http://localhost"
12+
]
13+
}
14+
}

man/sheets_auth_configure.Rd

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)