Giter Club home page Giter Club logo

Comments (7)

virtualstaticvoid avatar virtualstaticvoid commented on June 21, 2024

Hi @gbultman

The simple answer is that when your application is deployed and run on Heroku, it's then running on the server side, which is headless, and therefore cannot run a browser or any user interface for that matter.

What is the OAuth2 token used for? Is it so that your R code can consume a 3rd party service?

Regards
Chris

from heroku-buildpack-r.

gbultman avatar gbultman commented on June 21, 2024

Thanks for the prompt reply, Chris. Yeah. Specifically, Hubspot CRM data. Should I be looking into your docker solution? I'm pretty new to the web deployment side of things, but pretty familiar with R. RServer looks good but then I'd have to ditch Heroku, I think.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on June 21, 2024

The easiest way around this would be to use a Hubspot API key instead of using OAuth2 to authenticate.

You will need to generate/retrieve the Hubspot API key and then change your app to use it to authenticate instead of using the OAuth method. Use an environment variable to "pass through" the key from the host to your R code, such as:

hubspotApiKey <- Sys.getenv('HUBSPOT_API_KEY')

# code to instantiate Hubspot client, providing hubspotApiKey...

Then configure your app's environment variables on Heroku to include the API key. This way the code is the same for both local and deployed scenarios.

Alternatively, if you intend for you application to be used by other people, and have it connect to their Hubspot accounts, then you will need to implement the Authorization Code Flow, which is quite a bit more involved to implement.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on June 21, 2024

... and, in this example the docker version of the buildpack would need to be implemented in much the same way. I.e. It also runs headless, so won't have access to the browser on the server side.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on June 21, 2024

Hi @gbultman
Did you manage to get it working?

from heroku-buildpack-r.

gbultman avatar gbultman commented on June 21, 2024

I did. I ended up just saving the token in the root directory. Right now, it is doing stale refreshes, but I plan on just getting a service token. I was able to use that for manipulating things on my google drive - saving data etc. It's not ideal, but it works for now.

Thanks for your help.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on June 21, 2024

Okay thanks. I'll close the issue.

from heroku-buildpack-r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.