Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Durrab Khan
Auto Login Hook in Liferay 6.1.1
August 26, 2012 1:45 AM
Answer

Durrab Khan

Rank: New Member

Posts: 13

Join Date: May 11, 2012

Recent Posts

I am using Liferay 6.1.1 the latest one and I have created the Auto Login - My Scenario is the pass a card number instead of email and then grab the email address from database and return the valid credentials like the following below

 1if(userName != null && userName.equals("123456")
 2&& password.equals("password")) // here I have the valid password so grab the email address from database and pass credentials and return it
 3{
 4System.out.println("Valid Request must authenticate");
 5credentials = new String[3];
 6credentials[0] = "durrab@liferay.com";
 7credentials[1] = password;
 8credentials[2] = Boolean.TRUE.toString();
 9return credentials;
10}


I expect that way liferay will get the email address and validate the user.
But Liferay always invalidate that request and gives me an error message that user is not authenticated

I have created it as a hook in liferay 6.1.1 and configured in the portal.properties as auto.login.hooks=myAutoLogin

Need a help

Thanks

Durrab
Sampsa Sohlman
RE: Auto Login Hook in Liferay 6.1.1
August 27, 2012 5:49 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 227

Join Date: September 27, 2007

Recent Posts

Some clarifications:

Where this "card number" would be inserted?
Durrab Khan
RE: Auto Login Hook in Liferay 6.1.1
September 1, 2012 12:06 AM
Answer

Durrab Khan

Rank: New Member

Posts: 13

Join Date: May 11, 2012

Recent Posts

card number is coming from the request parameter for login

So My logic is to get the user_id on the basis of card number and then pass that user_id for the authentication in auto login
Harish Kumar
RE: Auto Login Hook in Liferay 6.1.1
September 1, 2012 12:34 AM
Answer

Harish Kumar

Rank: Expert

Posts: 474

Join Date: July 31, 2010

Recent Posts

Hi Durrab,

I've already answered this question in your previous post.
Apoorva Prakash
RE: Auto Login Hook in Liferay 6.1.1
September 1, 2012 12:37 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hi khan,
It's good that you are getting card number as a parameter in request, but for getting userid and password for validating, you need to have a card number in database, so that you can get matching entry of userid/password.

You can store the card number in custom attribute.

Hope this will help.
Thanks,
Apoorva Prakash

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