cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1168
Views
0
Helpful
1
Replies

WebEx API :RS=MissingOrInvalidCSRFToken

m.lambrechts
Level 1
Level 1
Actually when i connect to webexroom, I have a error RS=MissingOrInvalidCSRFToken. I implemented the changes as in “URL API WBS 31 RELEASE NOTES” to retrieve the token. There is no problem when retrieving the token but when I try to join a meeting i always get the error. Below you will find the code implemented, could you help me?
Step 1 :Call Login API Request Method POST : https://mywebsite.webex.com/mywebsite/p.php => {AT=LI} , {WID= xxx}, {PW= yyy}
Response Content :
<html> <head> <title> </title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="description" content="231"><link rel="shortcut icon" href="https://community.cisco.com/favicont29.ico" type="image/x-icon"> </head> <body> <form id="commonGet2PostForm"></form> <script src="/cmp3100/webcomponents/html/js/commonGet2Post.js"></script> <script language="JavaScript"> var url = "https\x3a\x2f\x2fmywebsite.webex.com\x2fmw3100\x2fmywebex\x2fdefault.do\x3fsiteurl\x3dmywebsite\x26CSRF\x3d907acb72-81fe-4f73-a183-79480d123e03"; var formID = "commonGet2PostForm"; generateAndSubmitForm(url, formID); </script> </body> </html>

Step2 : ParseCSRF
CODE:
private string parseCSRFToken(string res) { String csrfToken = ""; Regex csrfParrern = new Regex("\\\\x26CSRF\\\\x3d(.+?)\"", RegexOptions.Compiled); MatchCollection matches; if (!string.IsNullOrEmpty(res)) { matches = csrfParrern.Matches(res); if (matches.Count > 0) { Match match = matches[0]; // only one match in this case GroupCollection groupCollection = match.Groups; csrfToken = groupCollection[1].ToString(); } } return csrfToken; }
Result : 907acb72-81fe-4f73-a183-79480d123e03

Step 3 :Connect to meeting Request Method GET : https://mywebsite.webex.com/mywebsite/m.php => {AT=HM},{MK= 956929082},{CSRF=907acb72-81fe-4f73-a183-79480d123e03} result = https://mywebsite.webex.com/mw3100/mywebex/default.do?siteurl=mywebsite&AT=HM&RS=MissingOrInvalidCSRFToken&ST=FAIL

1 Accepted Solution

Accepted Solutions

ryanhunt
Level 5
Level 5

The WebEx URL API is designed to be used in a web browser, if your trying to run commands from a server side it will not maintain the browser session and the session will be terminated when its closed.

Take a look at the WebEx XML API, its more suited for non-browsers and much more capable.

https://developer.cisco.com/site/webex-developer/develop-test/xml-api/xml-api-reference/

View solution in original post

1 Reply 1

ryanhunt
Level 5
Level 5

The WebEx URL API is designed to be used in a web browser, if your trying to run commands from a server side it will not maintain the browser session and the session will be terminated when its closed.

Take a look at the WebEx XML API, its more suited for non-browsers and much more capable.

https://developer.cisco.com/site/webex-developer/develop-test/xml-api/xml-api-reference/