Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ankit Srivastava
CAS with Liferay Database
October 9, 2012 9:55 PM
Answer

Ankit Srivastava

Rank: Regular Member

Posts: 197

Join Date: April 15, 2011

Recent Posts

Hi,

I have already configured Liferay with CAS, But it uses SimpleTestUsernamePasswordAuthenticationHandler for authentication.
When i provide username = password, I am able to login into Liferay.
Now i want to configure CAS for authentication against Liferay Database(user_ table).
Did anyone work on this?
Please provide me steps or document to achieve this.

Thanks:
Apoorva Prakash
RE: CAS with Liferay Database
October 10, 2012 2:43 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hey Tonu,

There are basically 3 handlers...
1. BindModeSearchDatabaseAuthenticationHandler (responsible for verifying access to a db schema with a username / password)
2. QueryDatabaseAuthenticationHandler (responsible for verifying authentication via a sql query)
3. SearchModeSearchDatabaseAuthenticationHandler (responsible for verifying authentication triplet starting from the user table, username and password, conveniently mapped)

We have to use SearchModeSearchDatabaseAuthenticationHandler in Liferay using the following entry:
1 <bean class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler">
2            <property name="tableUsers"> <value> user_ </ value> </ property>
3            <property name="fieldUser"> <value> emailAddress </ value> </ property>
4            <property name="fieldPassword"> <value> password_ </ value> </ property>
5            <property name="dataSource" ref="dataSource"/>
6 </ bean>


In addition you also need to write your own password encryption class.

Hope this will help...

Thanks and Regards,
Apoorva Prakash

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!