|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionDuring my implementation of the Central Authentication Service (CAS), my client did not want to support the service registry portion of the CAS WAR. The CAS Web application has a few JSP pages to provide a UI for the registry of applications or services that will be CAS supported. Our Security Chief did not want to provide any administrative access in the application that would verify our users and credentials for the enterprise. Originally we used the service manager and because Spring webflow is used, the directory at /services could just be removed once the applications were registered. This was clean and did not present any error messages. In fact, if the service URL was called, the login page was presented. Perfect right? Not really. My CAS WAR has been modified now to support the removal of the Service Manager application altogether. Prior to these modifications, the service registry was being persisted to the file system using the HSQL database and CAS provided persistence classes. I have developed a simpler mechanism for registering the service applications by configuring them in a Spring context file and loading them into memory whenever CAS is deployed. This is accomplished using a custom implementation of The Code/*
* Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license
* distributed with this file and available online at
* http://www.uportal.org/license.html
*/
package org.jasig.cas.services;
import java.util.*;
import org.jasig.cas.util.DefaultLongNumericGenerator;
import org.jasig.cas.util.LongNumericGenerator;
import org.jasig.cas.util.annotation.NotNull;
/**
* Brute-force Service Registry Dao for production use (limited service registry).
* This class is created for a small number of service registrations that will
* be Spring configured and managed without the use of the services Web
* interface.
*
* @author David Whitehurst
* @version $
* @since 3.1
*
*/
public final class EasyServiceRegistryDaoImpl implements ServiceRegistryDao {
@NotNull
private List
Registering services for CAS is very easy now. In the service registry section of WEB-INF/deployerConfigContext.xml, the services can be added with just a name and the URL. Remember that the URL uses the Apache regular expression syntax. <!--
|
| This DAO implementation allows for the registration of
| CAS services at a configuration level.
| hard coded service registry.
| The cas/services directory can be removed from /WEB-INF/view/jsp
| so that UI access to the service manager is completely disabled.
| The following properties are set as true by default,
| enabled, allowed to proxy, and SSO.
|
+ -->
<bean
id="serviceRegistryDao"
class="org.jasig.cas.services.EasyServiceRegistryDaoImpl">
<property name="serviceMap">
<map>
<entry key="Test Application" value="http://localhost:8080/test1/**" />
</map>
</property>
</bean>
|
||||||||||||||||||||||||||||||