Please does anyone have an idea on how to implement OAuth using httr package for a system that is automatically built using Travis CI?
The problem here is to be able to securely have the token within the Travis environment.
I tried to automatically generate the token within Travis during build, but build hangs for a long time and then terminates. I guess the OAuth flow waits for authentication via a browser and then fails when nothing happens.
I am able to authenticate on my local PC, because when prompted on the browser, I just click 'OK' to authenticate.
What service are you trying to authenticate with? For what purpose? Are you querying information or deploying your code to another service?
Instead of generating the token during the CI build, have you tried generating the token locally, encrypting it, and then sending it to Travis? For an example, see these instructions from Jenny Bryan to register a Google OAuth token with Travis.