You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am authorising as a Freshbooks consumer with OAuth. Each of my users may have his own Freshbooks account. Each Freshbooks user has his own subdomain (e.g. example.freshbooks.com). In order to authorise, I have to use urls on that subdomain.
I couldn't find an easy way to change the 'site' option for each user. I ended up overriding OauthConsumersController#show with this:
It's far from beautiful and obviously fragile, so I would love to know the 'right' way of doing it.
BTW, it was not straightforward to configure Freshbooks, so I include my Token here in case it saves somebody some time:
require'oauth/signature/plaintext'classFreshbooksToken < ConsumerTokenFRESHBOOKS_SETTINGS={:site=>"",:request_token_path=>"/oauth/oauth_request.php",:access_token_path=>"/oauth/oauth_access.php",:authorize_path=>"/oauth/oauth_authorize.php",:scheme=>:query_string,#this is the only one Freshbooks accepts:signature_method=>"PLAINTEXT",# this is the only one Freshbooks accepts}defself.consumer(options={})@consumer ||= OAuth::Consumer.new(credentials[:key],credentials[:secret],FRESHBOOKS_SETTINGS.merge(options))endend
Thanks in advance
The text was updated successfully, but these errors were encountered:
I am authorising as a Freshbooks consumer with OAuth. Each of my users may have his own Freshbooks account. Each Freshbooks user has his own subdomain (e.g. example.freshbooks.com). In order to authorise, I have to use urls on that subdomain.
I couldn't find an easy way to change the 'site' option for each user. I ended up overriding OauthConsumersController#show with this:
It's far from beautiful and obviously fragile, so I would love to know the 'right' way of doing it.
BTW, it was not straightforward to configure Freshbooks, so I include my Token here in case it saves somebody some time:
Thanks in advance
The text was updated successfully, but these errors were encountered: