-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring OAuth tokens on a per-connection basis. #177
Comments
Not yet. I've got an idea for how I plan to implement this but it's not been developed yet. |
How does one even use this gem for OAuth in an application with more than one user. |
I would also be very interested in this addition. Until then I'm just re-initializing the configuration every time. |
@rgardien honestly, no offense to the gem, but it seemed overly complicated to add this functionality so I just rolled my own and it was pretty simple. I don't even understand the purpose of this gem supporting OAuth when it doesn't support dynamic clients. Anyway I wrote a basic API class and used this OAuth gem to handle the OAuth process. Figured I'd share it here since it may save anyone sometime that needs a dynamic client. https://gist.github.com/jclusso/cda0df8bd127d716cf1bb859cbf7d008 |
@jclusso Thanks! And yes, supporting OAuth without supporting dynamic clients is strange. |
I believe the original use-case was for companies to push data to their own Hubspot portals rather than companies developing Hubspot integrations that would need to push data to multiple Hubspot portals. |
@cbisnett just not sure why anyone would use OAuth then. |
Some of the endpoints require an OAuth token rather than an API key. Creating timeline events is one such endpoint: https://developers.hubspot.com/docs/methods/timeline/create-or-update-event. |
@cbisnett ahh that makes sense. That's pretty silly on HubSpot's part, but now it all makes sense. Thanks for pointing that out. |
@cbisnett Any high-level thoughts you'd be willing to share about how you'd like this to be implemented? This feature is important to me and I am willing to help out however possible. |
Would also like this feature if possible so would be good to know some ideas. At the moment, I'm trying out wrapping any requests in a block that sets the configuration for the request only and then resets. def with_configuration(&block)
Hubspot.configure(hapikey: <key>)
response = yield
Hubspot::Config.reset!
response
end response = with_configuration { Hubspot::Contact.all } Would need a little bit more work for OAuth |
After reading the docs I assume the OAuth tokens are configured globally.
Is there any possible way to configure them on per-connection basis?
The text was updated successfully, but these errors were encountered: