{"action":"created","issue":{"url":"https://api.github.com/repos/artemklevtsov/RGA/issues/10","labels_url":"https://api.github.com/repos/artemklevtsov/RGA/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/artemklevtsov/RGA/issues/10/comments","events_url":"https://api.github.com/repos/artemklevtsov/RGA/issues/10/events","html_url":"https://github.com/artemklevtsov/RGA/issues/10","id":124219094,"number":10,"title":"Invalid Credentials","user":{"login":"mischa2002k2","id":11887433,"avatar_url":"https://avatars.githubusercontent.com/u/11887433?v=3","gravatar_id":"","url":"https://api.github.com/users/mischa2002k2","html_url":"https://github.com/mischa2002k2","followers_url":"https://api.github.com/users/mischa2002k2/followers","following_url":"https://api.github.com/users/mischa2002k2/following{/other_user}","gists_url":"https://api.github.com/users/mischa2002k2/gists{/gist_id}","starred_url":"https://api.github.com/users/mischa2002k2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mischa2002k2/subscriptions","organizations_url":"https://api.github.com/users/mischa2002k2/orgs","repos_url":"https://api.github.com/users/mischa2002k2/repos","events_url":"https://api.github.com/users/mischa2002k2/events{/privacy}","received_events_url":"https://api.github.com/users/mischa2002k2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-29T14:35:11Z","updated_at":"2015-12-29T15:59:00Z","closed_at":null,"body":"Hi,\r\nthe code and everything works just fine. But if the token expires, my code is not working any more:\r\n\r\n```r\r\nauthorize(\r\n  client.id=options()$apiSecrets$id, \r\n  client.secret=options()$apiSecrets$clientSecret,\r\n  cache=paste(getwd(),\"daToken\",sep=\"/\")\r\n)\r\n```\r\n\r\nMessage:\r\n\r\n```r\r\nError : client error: (401) Unauthorized\r\nAuth error: Invalid Credentials\r\n```\r\n\r\nHow can I make sure, the code will persist the token? I don't want to login every single time in my browser. Plus: after the token expires my whole code is not working any more. What is the desired practice on this point? "},"comment":{"url":"https://api.github.com/repos/artemklevtsov/RGA/issues/comments/167818941","html_url":"https://github.com/artemklevtsov/RGA/issues/10#issuecomment-167818941","issue_url":"https://api.github.com/repos/artemklevtsov/RGA/issues/10","id":167818941,"user":{"login":"artemklevtsov","id":603798,"avatar_url":"https://avatars.githubusercontent.com/u/603798?v=3","gravatar_id":"","url":"https://api.github.com/users/artemklevtsov","html_url":"https://github.com/artemklevtsov","followers_url":"https://api.github.com/users/artemklevtsov/followers","following_url":"https://api.github.com/users/artemklevtsov/following{/other_user}","gists_url":"https://api.github.com/users/artemklevtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/artemklevtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemklevtsov/subscriptions","organizations_url":"https://api.github.com/users/artemklevtsov/orgs","repos_url":"https://api.github.com/users/artemklevtsov/repos","events_url":"https://api.github.com/users/artemklevtsov/events{/privacy}","received_events_url":"https://api.github.com/users/artemklevtsov/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T15:59:00Z","updated_at":"2015-12-29T15:59:00Z","body":"Now I tired use the old token with success result:\r\n\r\n```r\r\nlist_profiles(token  = readRDS(\".ga-token.rds\")[[1]])\r\n#> Auto-refreshing stale OAuth token.\r\n#>           id account.id webproperty.id internal.webproperty.id                      name currency      timezone\r\n```"}}