Guest User

Untitled

a guest
Feb 15th, 2018
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. Hi Everyone,
  2.  
  3.  
  4. I'm trying to login adobeconnect through iframes ondemand but it doesn't work for me.
  5. I tried the below two ways please but two ways doesn't work I don't know where I made mistake
  6. please check it once If anybody having idea please let me know I 'm trying this from last three days
  7. .
  8.  
  9.  
  10. Process 1:
  11. --------------
  12. Apex class:
  13. ------------
  14. public pageReference processButtonClick(){
  15.  
  16. Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
  17.  
  18. PageReference pageref = new PageReference('https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxx.com&password=xxxxxxxxx&domain=acme.adobe.com&session='+cookie);
  19. return pageref;
  20.  
  21. }
  22. public PageReference doLogin(){
  23. PageReference pageref2 = new PageReference('/apex/AdobeIframe');
  24. return pageref2;
  25.  
  26. }
  27.  
  28. vf page 1 :
  29. ----------
  30.  
  31. <apex:form >
  32. <center>
  33. <apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
  34. <apex:commandButton value="Create Webinar" action="{!doLogin}"/>
  35. </center>
  36. </apex:form>
  37.  
  38. vf page 2 :
  39. -------------
  40. <apex:page>
  41. <apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
  42. </apex:page>
  43.  
  44.  
  45. here by clicking the "Login to Adobe" button I get the response in browser like below
  46.  
  47. Response :
  48. ----------
  49. <results>
  50. <status code="ok"/>
  51. <OWASP_CSRF_TOKEN>
  52. <token>5c7b280238eb9c73da734acb5988082d87dfa9125c697e0e6bff7049d6ca8479</token>
  53. </OWASP_CSRF_TOKEN>
  54. </results>
  55.  
  56. after that I'm clicking the button called "Create Webinar" then only it taken to login and directly opend adobe connect home page.
  57.  
  58. 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.
  59. instead of login it redirects to login page.For login I want to do the same process above explained.
  60.  
  61. how can I avoid for every time generate the response in browser.
  62.  
  63. **And also I tried the second process**
  64.  
  65. Process 2 :
  66. -----------
  67. VF Page 1:
  68. ----------
  69.  
  70. <apex:form >
  71. <center>
  72. <apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
  73. </center>
  74. </apex:form>
  75.  
  76. VF Page 2:
  77. -----------
  78. <apex:page>
  79. <apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com" scrolling="true"/>
  80. </apex:page>
  81.  
  82.  
  83. apex class:
  84. -----------
  85. public pageReference processButtonClick(){
  86.  
  87. Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
  88.  
  89. String username = lst1.username__c;
  90. String password = lst1.password__c;
  91. String url = lst1.url__c;
  92. String cookie = lst1.Cookie__c;
  93.  
  94. //REST api calling
  95. CreateWebinar.postfieldsFuture(username,password,url,cookie);
  96. PageReference pageref2 = new PageReference('/apex/AdobeIframe');
  97. return pageref2;
  98.  
  99. }
  100.  
  101. REST api :
  102. ----------
  103. global class CreateWebinar{
  104.  
  105. @future (callout=true)
  106. global static void postfieldsFuture(String username, String password,String url,String cookie){
  107.  
  108. getParticipants(username, password, url,cookie);
  109. }
  110.  
  111. global static HttpResponse getParticipants(String username, String password,String url,String cookie){
  112.  
  113. Http http = new Http();
  114. HttpRequest req = new HttpRequest();
  115. HttpResponse res = new HttpResponse();
  116. Blob headerValue = Blob.valueOf(username + ':' + password);
  117. String authorizationHeader = 'BASIC ' +
  118. EncodingUtil.base64Encode(headerValue);
  119. req.setHeader('Authorization', authorizationHeader);
  120. req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
  121. req.setMethod('GET');
  122. req.setHeader('Content-Type', 'application/json');
  123. req.setHeader('Accept','application/json');
  124. res = http.send(req);
  125. System.debug('MyResult == :'+res.getBody());
  126. Dom.Document doc = res.getBodyDocument();
  127. Dom.XMLNode results = doc.getRootElement();
  128. Dom.XMLNode OWASP_CSRF_TOKEN = results.getChildElement('OWASP_CSRF_TOKEN', null);
  129. String accesstokenvalue = OWASP_CSRF_TOKEN.getChildElement('token', null).getText();
  130. System.debug('AccessToken:::----'+accesstokenvalue );
  131.  
  132. }
  133. }
  134.  
  135.  
  136. After the clicking the "Login to Adobe" button it redirects to adobe connect login page,but doesn't taken login directly.
  137.  
  138. I don't know where should i made mistake.Please help me I tried this from last three days.
  139.  
  140. Thanks
  141. Johnny
Add Comment
Please, Sign In to add comment