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
Nand Kishore 7Nand Kishore 7 

How can we use a single redirect URL in multiple Salesforce orgs?

Hi All,

I am creating an application which will integrate with third party application. I am using third party system for authentication. 
I got the redirect URL (which is of my org), secret key etc.
Redirect URL - https://test-dev--c.na90.visual.force.com/apex/TestVFPage1
I developed this application and its working good at my development environment.

Now, I created a managed package of my application (TestVFPage1 visualforce page is a part of package) and installed for a customer. When customer started to authenticate, he was redirected to my org's URL (https://test-dev--c.na90.visual.force.com/apex/TestVFPage1) at the time of authentication. He should be redirected to his org.

I want to know how we can handle this kind of scenario in Salesforce.
Note: My limitation is to use any single URL as a redirect URL and it should work for all the customers. This package will be installed on many orgs.

Waiting for respone. Thank You!!
VinayVinay (Salesforce Developers) 
Hi,

You need to set up in the customer org which will have

> Redirect URL for customer Org
> And a unique Client Id and Client Secret.

You can use custom settings to set these values.

Create installation documentation for the customers which can include these steps.

Hope above information was helpful.

Thanks,
Nand Kishore 7Nand Kishore 7
Hi Vinay,
'Thank You for the response.

Redirect URL will be unique.  How can one redirect url work for other org?

My limitation is "I have a only redirect URL, ClientId and ClientSecret which will be used by all the clients".

Thanks,
 
VinayVinay (Salesforce Developers) 
You would need to update manually 'Redirect URL' as a post-installation step.  This might not work when you set up in the customer's org.

Use custom settings to store client id and secret values.

Thanks,
Nand Kishore 7Nand Kishore 7
Hi Vinay,

If I set the 'redirect URL' as a post installation step. Since, I have a single Redirect URL, how can i set this url for all the org.
Org1.
Domain -  abc.com
Redirect URL - abc.com/apex/VFPage1

Org2:
Domain - xyz.com
Redirect URL - abc.com/apex/VFPage1   (How can I set like this?)

We can store client id and client secret in custom setting. This will be going unique for all the customer.

My limitation is "I have a single redirect URL, single  ClientId and single ClientSecret which will be used by all the clients". With this limitation, Authentication should run for all the salesforce orgs.

Thank You!!