掲示板

Users from external database

16年前 に Migue M L によって更新されました。

Users from external database

New Member 投稿: 15 参加年月日: 07/12/05 最新の投稿
Hi,

I have a custom user database , and I'd like that Liferay authenticate against it. Can I do that without CAS or Acegi?, only configuring portal or Application server descriptors. I use JBoss AS 4.2

Thank you in advance
16年前 に Darshak Thakore によって更新されました。

RE: Users from external database

Junior Member 投稿: 35 参加年月日: 07/03/27 最新の投稿
Migue M L:
Hi,

I have a custom user database , and I'd like that Liferay authenticate against it. Can I do that without CAS or Acegi?, only configuring portal or Application server descriptors. I use JBoss AS 4.2

Thank you in advance


Here's one way to do it. I'm not sure if this is the best way to do it but it worked for us.

Assuming you have the portal and the ext environment setup

1. Implement the com.liferay.portal.security.auth.Authenticator interface in the ext environment. Basically this entails implementing the three methods {authenticateByEmailAddress, authenticateByScreenName, authenticateByUserId}

2. Create the portal-ext.properties file in the ext environment under ext-impl/classes/ folder. Copy/override the auth.pipeline.pre property and give the FQ class name of the class u created in Step 1

3. Now you have two options regarding Liferay's inbuilt authentication. You can override the auth.pipeline.enable.liferay.check property in the portal-ext.properties file. If you set this property to true, then during authentication, first your custom authenticator will be called and if it succeeds, then liferay will also authenticate against its internal database. If you set this property to false, then only your custom authenticator will be responsible for the authentication.
Note that if you set this property to true, you have to have some mechanism to synchronize the passwords between your external database and liferay's database. If you set this to false, you will still need to have some mechanism of importing users in the liferay database but you do not need to worry about password sync.

The flip side to disabling the above property is that even the "impersonate user" functionality will stop working.

Hope this helps.
16年前 に Migue M L によって更新されました。

RE: Users from external database

New Member 投稿: 15 参加年月日: 07/12/05 最新の投稿
Thank You,

It's looks a good solution but is too much complex for my application, I think. I supposed that I can configure the authentication modiying descriptors like login-config.xml from JBoss AS. Is there any way to do that?
16年前 に Massimiliano Turri によって更新されました。

RE: Users from external database

New Member 投稿: 3 参加年月日: 07/02/15 最新の投稿
Hi,
I have a similar question.
I have a database of users and I am using CAS for authentication.
What is the best way to import these users in the liferay database?

In my current setup, when I go to the portal I get redirected to CAS. Upon successful login I get redirected to a sign-in page.

Any suggestions?
Thanks
Max
thumbnail
14年前 に Lisa Simpson によって更新されました。

RE: Users from external database

Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
If you're currently using CAS to authenticate your other application, just configure Liferay to use CAS as well. it's in the settings in the control panel.
14年前 に Phuc Minh Bui によって更新されました。

RE: Users from external database

Junior Member 投稿: 83 参加年月日: 09/02/02 最新の投稿
Darshak Thakore:
Migue M L:
Hi,

I have a custom user database , and I'd like that Liferay authenticate against it. Can I do that without CAS or Acegi?, only configuring portal or Application server descriptors. I use JBoss AS 4.2

Thank you in advance


Here's one way to do it. I'm not sure if this is the best way to do it but it worked for us.

Assuming you have the portal and the ext environment setup

1. Implement the com.liferay.portal.security.auth.Authenticator interface in the ext environment. Basically this entails implementing the three methods {authenticateByEmailAddress, authenticateByScreenName, authenticateByUserId}

2. Create the portal-ext.properties file in the ext environment under ext-impl/classes/ folder. Copy/override the auth.pipeline.pre property and give the FQ class name of the class u created in Step 1

3. Now you have two options regarding Liferay's inbuilt authentication. You can override the auth.pipeline.enable.liferay.check property in the portal-ext.properties file. If you set this property to true, then during authentication, first your custom authenticator will be called and if it succeeds, then liferay will also authenticate against its internal database. If you set this property to false, then only your custom authenticator will be responsible for the authentication.
Note that if you set this property to true, you have to have some mechanism to synchronize the passwords between your external database and liferay's database. If you set this to false, you will still need to have some mechanism of importing users in the liferay database but you do not need to worry about password sync.

The flip side to disabling the above property is that even the "impersonate user" functionality will stop working.

Hope this helps.


I followed your instruction. Liferay understands my class that implemented com.liferay.portal.security.auth.Authenticator, but I wonder how to implement those methods ? Do we have to implement any class else ???
Because I assume to return the value Authenticator.SUCCESS, but it still displays
You have entered invalid data. Please try again.
Please enter a valid login.


Looking forward to your replies
Thanks a lot
Phuc Bui
13年前 に Adolfo Escolano によって更新されました。

RE: Users from external database

Junior Member 投稿: 27 参加年月日: 11/01/31 最新の投稿
and about synchronize the passwords between an external database and liferay's database,
Any help?
8年前 に Chennamma Rathode によって更新されました。

RE: Users from external database

Junior Member 投稿: 45 参加年月日: 15/08/05 最新の投稿
Hi i also have same requirement.
I have done R&D but no solutions.
Is this implemented in liferay or not?
8年前 に Chennamma Rathode によって更新されました。

RE: Users from external database

Junior Member 投稿: 45 参加年月日: 15/08/05 最新の投稿
I have urgent requirement if any one know how to achieve this please help me..