Activity Forums Salesforce® Discussions In an internal SFDC Http Get from a VF Page, how do I authenticate for the redirected URL?

  • Gourav

    Member
    June 9, 2016 at 1:55 pm

    When you're in Visualforce, your domain will always be something like c.cs7.visualforce.com. However, other salesforce pages such as standard pages will be delivered by cs7.salesforce.com Your session Id from within c.cs7.visualforce.com will NOT work within cs7.salesforce.com So to execute an HTTP get on a resource in the alternate domain, you have to authenticate with that new domain. This can be done in one of 2 ways:

    • Load either the Enterprise or Partner WSDL back into Salesforce and use the "Login" API call.
    • Since you're only using one API call, it might be adequate to just create your own XML Soap message for the login. You should be able to easily search the response Body for the session Id.

    Once you have the session Id, execute a single http GET to the corresponding domain and you won't be redirected.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos