members
Feb 03, 2010
How to add CAS Authentication
by
Tyler Randles
—
last modified
Feb 03, 2010 09:40 AM
- To bring setting up Plone for CAS authentication we need to install an add on, so navigate to the portal_quickinstaller

- Now install UI for CAS Login (Castle)

- Navigate to acl_users and add CAS Auth Helper

- Both the Id and Title are Kerberos

- Kerberos will now appear in /PloneSite/acl_users/ like bellow

- Click on Kerberos and select Authentication, Challenge, Reset Credentials, and Extraction

- Click the properties tab for the Kerberos object and set these values:
- https://cas.ucdavis.edu:8443/cas/login
- https://cas.ucdavis.edu:8443/cas/logout
- https://cas.ucdavis.edu:8443/cas/validate

- Now customize the login_form inside /Plonesite/portal_skins/plone_login

- The reason we need to customize the login_form, is to that it redirects to CAS
<div metal:fill-slot="main" tal:define="auth nocall:here/acl_users/credentials_cookie_auth|here/cookie_authentication|nothing; came_from request/came_from|request/HTTP_REFERER|nothing; came_from python:test(utool.isURLInPortal(came_from), came_from, None); errors options/state/getErrors; ac_name auth/name_cookie|string:__ac_name; ac_password auth/pw_cookie|string:__ac_password; ac_persist auth/persist_cookie|nothing; login_name python:request.get('login_name', request.get(ac_name, ''));"> <p i18n:translate="description_no_account" tal:define="join python:[a['url'] for a in actions['user'] if a['id']=='join']" tal:condition="python: join and checkPermission('Add portal member', here)"> If you do not have an account here, head over to the <span i18n:name="registration_form"> <a href="" tal:define="join python:join.pop(); join join; join python:join+test(join.find('?')==-1, '?', '&')+ztu.make_query(came_from=came_from);" tal:attributes="href join" i18n:translate="description_no_account_registration_linktext"> registration form</a></span>. </p> <dl class="portalMessage error" id="enable_cookies_message" style="display:none"> <dt i18n:translate=""> Error </dt> <dd i18n:translate="enable_cookies_message_before_login"> Cookies are not enabled. You must enable cookies before you can log in. </dd> </dl> <div tal:condition="python: not auth" i18n:translate="login_form_disabled"> While cookie authentication is disabled, cookie-based login is not available. </div> <metal:login define-macro="login"> <fieldset id="login-form"> <legend i18n:translate="heading_sign_in">Kerberos Authentication</legend> <div class="field login"> <metal:portlets define-slot="portlets_one_slot"> <tal:block replace="structure provider:plone.leftcolumn" /> </metal:portlets> </div> </fieldset> </metal:login> </div>
- Now we are done in the ZMI! Now lets head over to Plone http://plonesite.com/login_form. While nothing is there now have no worries! Click Manage Portlets.

- Add the CAS login portlet

- Now we must go through the motions and click save

- Almost done, the last thing to do it give it a good test! So click login and it should redirect you to CAS.

- If it says logout then job well done!

- Question? Comment? We have a comments area and we welcome them!



