Foren

Liferay Custom Authentication

thumbnail
Hamidul Islam, geändert vor 10 Jahren.

Liferay Custom Authentication

Regular Member Beiträge: 111 Beitrittsdatum: 22.05.08 Neueste Beiträge
Hi All,
I want to authenticate liferay user by my custom field (i.e., the filed is in another table but not in User_ table). Can anyone please guide me? I have gone through Authentication Pipe Line. I am little confused. Please help me if any body is aware of it.


Thanks & Regards
Hamidul Islam
thumbnail
Manish Yadav, geändert vor 10 Jahren.

RE: Liferay Custom Authentication

Expert Beiträge: 493 Beitrittsdatum: 26.05.12 Neueste Beiträge
Hamidul Islam:
Hi All,
I want to authenticate liferay user by my custom field (i.e., the filed is in another table but not in User_ table). Can anyone please guide me? I have gone through Authentication Pipe Line. I am little confused. Please help me if any body is aware of it.


Hi Hamidul Islam,
If you want to authenticate users from other than User_ table.
1.Users should be available in User_ table.
2. you can create hook or ext and write your custom code for authentication in UserLocaServiceImp.java method authenticateByEmailAddress() or authenticateByScreenName() or authenticateByUserId() as per your requirement.

Thanks & Regards
Manish Banwari lal Yadav
Email:- manishyadav1103@gmail.com
thumbnail
Hamidul Islam, geändert vor 10 Jahren.

RE: Liferay Custom Authentication

Regular Member Beiträge: 111 Beitrittsdatum: 22.05.08 Neueste Beiträge
Hi Manish,
I want to write my custom method i.e., athenticateByNIN(String ninId) in the hook. Now the concern is that how liferay will chose this method to authenticate user?


Thanks & regards
Hamidul Islam
Email:hamidulasm@gmail.com
thumbnail
Kan Zhang, geändert vor 10 Jahren.

RE: Liferay Custom Authentication

Junior Member Beiträge: 68 Beitrittsdatum: 01.12.10 Neueste Beiträge
Hi Hamidul,

I have draw a diagram illustrating Liferay Authentication process. Hope it will help.

As you can see in the diagram, you can implement your own Authenticator and call your custom athenticateByNIN(String ninId) method inside authenticateByEmailAddress(), authenticateByScreenName() and/or authenticateByUserId().

In com.liferay.portlet.login.util.LoginUtil.getAuthenticatedUserId() method, Liferay will decide which method to call based on the authentication type (by email, by screenname or by userId) you have set in the Portal Settings.

You can do the above in the Liferay hook.
-----------
But if your requirement is to add one more authentication type (i.e. called athenticate By NIN), you need to use ext plugin. Then you need to customize every places that references CompanyConstants.AUTH_TYPE_EA, CompanyConstants.AUTH_TYPE_SN and CompanyConstants.AUTH_TYPE_ID and add your own auth type there. Which I don't recommend.
thumbnail
Hamidul Islam, geändert vor 10 Jahren.

RE: Liferay Custom Authentication

Regular Member Beiträge: 111 Beitrittsdatum: 22.05.08 Neueste Beiträge
Thanks Kan Zhang. It helped me a lot. Nice explanation I ever found. Thank you again.


Regards
Hamidul Islam
asif aftab, geändert vor 10 Jahren.

RE: Liferay Custom Authentication

Regular Member Beiträge: 123 Beitrittsdatum: 02.09.13 Neueste Beiträge
Hi
Please if any one having code of the above discussed action then please share with me. My requirement is to authenticate the user by using credentials present in my table which is created by me. Means the authentication will takes place by using the data of my table but not by User_ table.
Please if any one having any information then provide to me.
Here I am trying to achieving this login by using ext and hook plugin. By using ext plugin I am overriding signin.jsp page and by using ext I am trying to overriding LoginAction class having login method. First time I am working on ext so I am not getting the core concept how I change the process of authentication from user_ table to table created by me. For authentication the data used is provided by my table not by lportal default table user_.
Thanks
asif aftab
thumbnail
Anil T, geändert vor 9 Jahren.

RE: Liferay Custom Authentication

Expert Beiträge: 313 Beitrittsdatum: 14.01.12 Neueste Beiträge
Hi Asif,

I have the same requirement. Did you get the authentication from your table ? Please share some code for the same.
Mohit ..., geändert vor 9 Jahren.

RE: Liferay Custom Authentication

New Member Beiträge: 20 Beitrittsdatum: 28.02.14 Neueste Beiträge
You can use Authenticator Interface to customize authentication.

Before that you have to create your own table which holds user details then in Custom class you can check these.
Which returns sucess,failure or DNE based on your requirement.
Shankar Pednekar, geändert vor 8 Jahren.

RE: Liferay Custom Authentication

New Member Beitrag: 1 Beitrittsdatum: 16.07.15 Neueste Beiträge
This is really helpful. What happens is when you are plugging in IDP Authentication code by implementing Authenticator interface, there would be need for SSO or CDSSO
Thanks,
Shankar Pednekar
Ramesh Yelda, geändert vor 8 Jahren.

RE: Liferay Custom Authentication

New Member Beiträge: 6 Beitrittsdatum: 30.12.15 Neueste Beiträge
Hello Every one Can u plz provide the code which u have written for custom login with userID and Emailaddress both.
divya goyal, geändert vor 7 Jahren.

RE: Liferay Custom Authentication

New Member Beiträge: 7 Beitrittsdatum: 11.11.14 Neueste Beiträge
I want to implement an SSO based solution which includes the oauth token, now after receiving the oauth token, i want to build a custom login mechanism(portlet preferably) in liferay which with authenticate the user in liferay and provide the access to the application. There is no way that we can received the password for the user as the user is already authorized by the authentication provider and published the oauth token.

Please help how can i authenticate the user in liferay and create a session for the user. and if user is not present in user_ table in that case i want to fetch the user details from LDAP and add those details in liferay for authentication without providing the password for the user. In the portlet if i can check that the user is not logged in and is not and omni user in that case how to authorize the user for giving the permission and creating the user object for login into portal.

What are the steps to move forward with liferay authentication.