{"id":333,"date":"2013-05-21T13:38:00","date_gmt":"2013-05-21T13:38:00","guid":{"rendered":"http:\/\/blog.law.gmu.edu\/webservices\/?p=333"},"modified":"2013-05-21T13:38:00","modified_gmt":"2013-05-21T13:38:00","slug":"phpcas-and-wordpress","status":"publish","type":"post","link":"https:\/\/sls.gmu.edu\/web\/2013\/05\/21\/phpcas-and-wordpress\/","title":{"rendered":"phpCAS and WordPress"},"content":{"rendered":"<p>Make sure your account is in the &#8220;Administrator&#8221; role, as you won&#8217;t be able to login as admin after switching to CAS.<\/p>\n<p>1. Download phpCAS and unzip\/untar it:\u00a0<a href=\"https:\/\/wiki.jasig.org\/display\/CASC\/phpCAS\">https:\/\/wiki.jasig.org\/display\/CASC\/phpCAS<\/a><\/p>\n<p>2. Download wpcas.zip and unzip it in wp-content\/plugins<\/p>\n<p>3. edit wp-content\/plugins\/wpcas\/wpcas.php and remove or comment out line 57:<\/p>\n<p><code>\/* $wpcas_options['server_path'] == '' || *\/<\/code><\/p>\n<p>4. Create wp-content\/plugins\/wpcas\/wpcas-conf.php with the following content (change &#8220;\/path\/to&#8221; to the path to CAS.php that you installed in step 1):<\/p>\n<p><code>&lt;?php<\/p>\n<p>\/\/ the configuration array<\/p>\n<p>$wpcas_options = array(<\/p>\n<p>'cas_version' =&gt; 'S1',<\/p>\n<p>'include_path' =&gt; '\/path\/to\/CAS.php',<\/p>\n<p>'server_hostname' =&gt; '<a href=\"http:\/\/login.gmu.edu\/\">login.gmu.edu<\/a>',<\/p>\n<p>'server_port' =&gt; '443',<\/p>\n<p>'server_path' =&gt; ''<\/p>\n<p>);<\/p>\n<p>\/\/ this function gets executed<\/p>\n<p>\/\/ if the CAS username doesn't match a username in WordPress<\/p>\n<p>function wpcas_nowpuser( $user_name ){<\/p>\n<p>die('you do not have permission here');<\/p>\n<p>}<\/p>\n<p>?&gt;<\/code><\/p>\n<p>4. Login with an account that&#8217;s in the Administrator role. \u00a0In &#8220;Plugins&#8221;, activate the wpCAS plugin.<\/p>\n<p>5. If possible, test in a separate browser. \u00a0When you click &#8220;Log in&#8221; you should be redirected to <a href=\"https:\/\/login.gmu.edu\/\">https:\/\/login.gmu.edu<\/a>. \u00a0Type in your PatriotPass NetID and password. \u00a0You should be redirected back to your WordPress site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Make sure your account is in the &#8220;Administrator&#8221; role, as you won&#8217;t be able to login as admin after switching to CAS. 1. Download phpCAS and unzip\/untar it:\u00a0https:\/\/wiki.jasig.org\/display\/CASC\/phpCAS 2. Download wpcas.zip and unzip it in wp-content\/plugins 3. edit wp-content\/plugins\/wpcas\/wpcas.php and remove or comment out line 57: \/* $wpcas_options[&#8216;server_path&#8217;] == &#8221; || *\/ 4. Create wp-content\/plugins\/wpcas\/wpcas-conf.php &hellip; <a href=\"https:\/\/sls.gmu.edu\/web\/2013\/05\/21\/phpcas-and-wordpress\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;phpCAS and WordPress&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[11],"tags":[25,34],"class_list":["post-333","post","type-post","status-publish","format-standard","hentry","category-web-development","tag-phpcas","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts\/333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":0,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts\/333\/revisions"}],"wp:attachment":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/media?parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/categories?post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/tags?post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}