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 

Adobe connect login doesn't work ondemand through iframes in salesforce?

Adobe connect login doesn't work ondemand through iframes in salesforce?

Hi Everyone,


I'm trying to login adobeconnect through iframes ondemand but it doesn't work for me.
I tried the below two ways please but two ways doesn't work I don't know where I made mistake
please check it once If anybody having idea please let me know I 'm trying this from last three days
.


Process 1:
--------------
Apex class:
------------
 public pageReference processButtonClick(){
        
        Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
       
       PageReference pageref = new PageReference('https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxx.com&password=xxxxxxxxx&domain=acme.adobe.com&session='+cookie);
       return pageref;
               
    }
    public PageReference doLogin(){
      PageReference pageref2 = new PageReference('/apex/AdobeIframe');
      return pageref2;
    
    }

vf page 1 :
----------

<apex:form >   
         <center>   
          <apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>  
          <apex:commandButton value="Create Webinar" action="{!doLogin}"/>  
         </center>
</apex:form>

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


here by clicking the "Login to Adobe" button I get the response in browser like below

Response :
----------
<results>
    <status code="ok"/>
    <OWASP_CSRF_TOKEN>
            <token>5c7b280238eb9c73da734acb5988082d87dfa9125c697e0e6bff7049d6ca8479</token>
    </OWASP_CSRF_TOKEN>
</results>

after that I'm clicking the button called "Create Webinar" then only it taken to login and directly opend adobe connect home page.

Note : If i click the "logout" button.after that I'm trying to login through directly from  "Create Webinar" button.at this time it won't taken to login access.
       instead of login it redirects to login page.For login I want to do the same process above explained.
       
       how can I avoid for every time generate the response in browser.
       
       **And also I tried the second process**
       
Process 2 :
-----------
VF Page 1:
----------

<apex:form >   
         <center>   
          <apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>  
         </center>
</apex:form>

VF Page 2:
-----------
<apex:page>
 <apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com" scrolling="true"/>
</apex:page>


apex class:
-----------
public pageReference processButtonClick(){
        
       Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
 
       String username = lst1.username__c;
       String password = lst1.password__c;
       String url      = lst1.url__c;
       String cookie   = lst1.Cookie__c;

       //REST api calling
       CreateWebinar.postfieldsFuture(username,password,url,cookie);       
       PageReference pageref2 = new PageReference('/apex/AdobeIframe');
       return pageref2;
       
}

REST api :
----------
global class CreateWebinar{  
 
    @future (callout=true)
    global static void postfieldsFuture(String username, String password,String url,String cookie){
        
        getParticipants(username, password, url,cookie);
    }
           
    global static HttpResponse getParticipants(String username, String password,String url,String cookie){  
         
        Http http = new Http();
        HttpRequest req =  new HttpRequest();          
        HttpResponse res =  new HttpResponse();          
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'BASIC ' +
        EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);              
        req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
        req.setMethod('GET');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Accept','application/json');
        res = http.send(req);
        System.debug('MyResult == :'+res.getBody());        
        Dom.Document doc = res.getBodyDocument();
        Dom.XMLNode results = doc.getRootElement();
        Dom.XMLNode OWASP_CSRF_TOKEN = results.getChildElement('OWASP_CSRF_TOKEN', null);
        String accesstokenvalue = OWASP_CSRF_TOKEN.getChildElement('token', null).getText();
        System.debug('AccessToken:::----'+accesstokenvalue );
        
  }
}


After the clicking the "Login to Adobe" button it redirects to adobe connect login page,but doesn't taken login directly.

I don't know where should i made mistake.Please help me I tried this from last three days.

Thanks
Basha