1

I need to get Start URL value or ACS URL value of Connected App in Salesforce via Javascript or Apex Class, any idea how to do that?

Regards, Gari

2 Answers 2

1

You can query for it in SOQL:

public with sharing class PageController {
    public PageReference getStartUrl() {
        AppMenuItem app = [
            SELECT StartUrl
            FROM AppMenuItem
            WHERE Name = 'app_name'
        ];

        return new PageReference(app.StartUrl);
    }
}

then surface on your page in a script tag etc:

<apex:page controller="PageController">
    <script>
        var startUrl = '{!JSENCODE(StartUrl)}';
    </script>
</page>
0

For 2020 -- read this article - https://help.salesforce.com/articleView?id=remoteaccess_auth_configuration_endpoint.htm&type=5

It does not seem that you can query the SalesforceLoginURL or OAuthToken URL / ACS URL through SOQL (tooling api or not). The SOQL query provided in the other answer against AppMenuItem returned null for my SSO connected apps. Maybe it worked in 2014.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .