KonaKart Community Forum

Installation / Configuration => Using KonaKart as a Portlet => Topic started by: sashwill on August 05, 2008, 05:26:17 pm

Title: Using portal login instead of KK login
Post by: sashwill on August 05, 2008, 05:26:17 pm
I'm rather new to all this so please forgive my simplistic question.

I've deploy KK on my Jetspeed 2.1.3 portal running on tomcat.

What are all the steps that I would need to take to use my portal login as my KonaKart login?

Thanks for any help :)
Title: Re: Using portal login instead of KK login
Post by: ryan on August 05, 2008, 06:15:41 pm
Hi,

I'm not a Jetspeed expert so not 100% sure of the plumbing involved. Here are some ideas:

Title: Re: Using portal login instead of KK login
Post by: sashwill on August 18, 2008, 08:01:04 pm
I've run the ant build script to make the konakart portlet, is there also a build script to run to create the admin app as a portlet?
Title: Re: Using portal login instead of KK login
Post by: Brian on August 18, 2008, 08:29:36 pm
Hi,

No we haven't got a build script like that for the Admin App...   If you end up creating one please send it to us or post it to the contributions section of the forum..  Thanks!

-Brian
Title: Re: Using portal login instead of KK login
Post by: sashwill on August 21, 2008, 05:47:54 pm
I looked at the credentials suggestion but it seems to still use the login page, useless I'm missing something?
So I still need a lot of help...
After someone has logged into my portal and they click the shopping tab which takes them to the KonaKart, I want them to be already logging into the konakart application. 
I saw this code supplied to someone else:

Class engineClass = Class.forName("com.konakart.app.KKEng");
KKEngIf eng = (KKEngIf) engineClass.newInstance();
  id = eng.login(userName, password);

Is there a place in the Konakart app that I can place this code and what do I do with the id when it's returned? If I can't modify konakart to perform this, what would I need to write.  I am trying to use as much of the default application as I can.

I'm assuming that since my portal already knows who they are, I can register them if they have not shopped with me before
What else do I need to do?
Title: Re: Using portal login instead of KK login
Post by: pete on August 21, 2008, 05:54:51 pm
All of the engine calls are done from Struts Action classes so you should look at the action classes such as LoginSubmitAction() and CustomerRegistrationSubmitAction() to figure out how to login and register a customer.
Title: Re: Using portal login instead of KK login
Post by: sashwill on September 02, 2008, 10:04:36 pm
My users aren't being logged in.
I inserted some code in the baseAction class:

LoginForm lf = new LoginForm();
        lf.setUser(request.getUserPrincipal().getName());
        lf.setPassword("genericPassword");
        kkAppEng.getCustomerMgr().login(lf.getUser(), lf.getPassword());
       


I wrote my own checkCredentials class and set it up in the configuration:

public class KonaLogin implements com.konakart.bl.LoginIntegrationMgrInterface  {

    public int checkCredentials(String arg0, String arg1) throws KKException {
        System.out.println("!!!!!!!!!!!!!!this is custom checkCredentials");
        return 1;
    }

It runs because I see the println

I am always returning a 1 because my internal users have already authenticated before they can get to the shopping cart. I thought that if I return a positive number the login should succeed?   

But as I said at the beginning it doesn't log the user in.  What am I doing wrong?
Title: Re: Using portal login instead of KK login
Post by: pete on September 02, 2008, 10:49:04 pm
Do you get any exceptions in the log ?
Have your users been registered in KonaKart ? If they don't exist in KonaKart you must register them before attempting a login.
Title: Re: Using portal login instead of KK login
Post by: sashwill on September 02, 2008, 11:16:15 pm
I get no exceptions in the log.

I check with  doesCustomerExistForEmail(username) and it returns true, but the kkAppEng.getSessionId() is null


I have added users directly into the database via an ETL from our database with the password set to "genericPassword" since i'm not really using this password. Is this the problem, if so how do i make it work by doing this since this is mode we prefer.
Do i need to populate other tables besides the "customers" table?
I thought that i told earlier the checkcredintials should handle this?
Title: Re: Using portal login instead of KK login
Post by: pete on September 03, 2008, 06:56:03 am
You should use our API to register the customers since the registration process touches several tables.
Title: Re: Using portal login instead of KK login
Post by: dnavarro on May 09, 2010, 04:54:25 pm

Hi,

   I've deploy KonaKart on my Liferay 5.2.3 portal, and as  sashwill  I would like to use my portal login as my KonaKart login.

   To do it, I register some users in konakartadmin, and, with the same email and password in Liferay,
and I've configured the LOGIN_INTEGRATION_CLASS with  com.konakart.bl.LoginIntegrationMgr

   When a customer make a login in Liferay, a Hook (a Liferay hook) executes:

KKAppEng kkAppEng = this.getKKAppEng(request, response);   //"this." because this class extends BaseAction
String sessionId = kkAppEng.getCustomerMgr().login(user, password);

but sessionId is always null.

   Is this the correct way to make a login?. (I'm following the "LoginSubmitAction" step by step as login sample).

   
Title: Re: Using portal login instead of KK login
Post by: dnavarro on May 14, 2010, 02:14:04 pm

Reading Ted http://www.konakart.com/forum/index.php/topic,999.msg4189.html#msg4189 (http://www.konakart.com/forum/index.php/topic,999.msg4189.html#msg4189)my question was solved.


Best regards,

  David.