function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yaroslav FilykYaroslav Filyk 

Connected App: Redirect to the same host request came from

Hi there,

I'm trying to create connected app for Salesforce. The problem is that my web application uses subdomains so I simply can't specify a recirect uri in a format Salesforce requires safely. Instead I'd like Salesforce to behave like Twitter.

If request comes from: `subdomain1.domain.com/auth/salesforce?...` I'd like redirect uri to be `subdomain1.domain.com/auth/salesforce/callback`
If request comes from: `subdomain2.domain.com/auth/salesforce?...` I'd like redirect uri to be `subdomain2.domain.com/auth/salesforce/callback`
etc...

Question:
Is what I want at all possible? If yes - which redirect_url should I specify in app settings?

Many Thanks
- Yaroslav

Best Answer chosen by Yaroslav Filyk
Yaroslav FilykYaroslav Filyk
For future reference, found an answer here: https://salesforce.stackexchange.com/questions/147003/can-a-callback-url-contain-wildcards .
Feeling depressed because Salesforce is so far behind almost all other omniauth providers who already allowed web apps with subdomains to use their strategies without much hassle.