constantcontact / ruby-sdk

Constant Contact Ruby SDK for v2 API
Other
17 stars 47 forks source link

Multi-tenancy support? #71

Closed gregblass closed 5 years ago

gregblass commented 5 years ago

Hey there.

We're implementing constant contact in a multi-tenant app using subdomains for account separation (like basecamp and slack). With other OAuth-based API's like HubSpot, we are able to pass in a redirect URL per tenant/account - like https://{tenant_1}.ourapp.com for tenant 1, and https://{tenant_2}.ourapp.com for tenant 2, so they would redirected to the proper account.

It seems as though we're limited in this case because the redirect URL has to be registered with Mashery and can't be passed in for each access token call?

Is there any way to get around this? Has anyone ever brought up this issue before?

What would we have to do as it stands - register multiple Mashery apps per client that wants to use Constant Contact with our software? Is that OK / doable?

gregblass commented 5 years ago

Looks like we can just pass in the specific tenant info via a parameter at the end of the uri:

https://community.constantcontact.com/t5/Developer-Support-ask-questions/Setting-up-authentication-but-need-a-variable-redirect-URI/m-p/281338#M10157

I'll report back once I've got that implemented to confirm that it is indeed possible.

gregblass commented 5 years ago

Actually, I'm not sure now, because in mashery it states: "URL query parameters not allowed" image

gregblass commented 5 years ago

You can use query parameters in the call, just not in the registration. So problem solved!