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
basha skbasha sk 

External website login through IFrames?

Hi All,

I'm trying to login third party external website from Salesforce IFrames.

For that I have developed a page with two buttons

> Button 1: Accesstoken

> Button 2 : Login

By clicking the "button 1" it generates a access token in browser like below response :

    <results>
        <status code="ok"/>
        <OWASP_CSRF_TOKEN>
            <token>0fb92008378bae5ff518192da6111695806d3f111468df6aa3d5c0879beba72b</token>
        </OWASP_CSRF_TOKEN>
    </results>
    
After that I click the "button 2" Then only it taken login to external website through iframe.

Problem: How can I login external website instead of generating access token visually?.

VF Page :
-----------

            

    <apex:page standardController="Test__c" extensions="CreateAdobeWebinar">
        <apex:form >        
             <center>   
                 <apex:commandButton value="Accesstoken" action="{!processButtonClick}"/>  
                 <apex:commandButton value="Login" action="{!doLogin}"/>            
             </center>
        </apex:form>
    </apex:page>

Apex Class :
------------

    public class CreateAdobeWebinar {
        Public String password;
        Public String url;
        Public String accesstoken;
        public PageReference pageref2{get;set;}
        public Test__c login;
                   
            public CreateAdobeWebinar(ApexPages.StandardSetController controller){       
                this.login= (Test__c)controller.getRecord();             
            }
            
            public CreateAdobeWebinar(ApexPages.StandardController controller){}   
            
            public PageReference processButtonClick(){
              
                PageReference pageref = new PageReference('https://xxxxxxxxxx/api/xml?action=login&login=xxxxxx@gmail.com&password=xxxxxx&domain=xxxxxxx.com&session='+cookie);
                  //PageReference pageref2 = new PageReference('/apex/AdobeIframe');
                 return pageref;                          
          }
            
            public PageReference doLogin(){
              PageReference pageref2 = new PageReference('/apex/AdobeIframe');
              return pageref2;
            
          }
        }

AdobeIframe Page:
-----------------

    <apex:page standardController="Test__c">
        <apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
    </apex:page>


Thanks,
Basha
Venu KoduruVenu Koduru
Hi Basha, were you able to achieve this?