1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Fall Back to Kayako Credentals

Discussion in 'LoginShare' started by peterz, Jan 16, 2012.

  1. peterz

    peterz Member

    I have successfully integrated LDAP authentication module but need to allow users who are not in LDAP ability to log into support using local credentials.

    I already have code that will deny login if password fails, etc. I am looking for what specific code I would need to use the kayako database as source for login details.

    Thank you.
  2. Larry Deeder

    Larry Deeder Member

    I am in the same boat. I have LoginShare auth working for users, but need the fall back to Kayako database because I want a mixed environment.

    FYI: I also have the ldap.php allowing for both SAM and UPN login if anyone is interested. I paid to have it done, but am willing to share for free.
  3. Vidar

    Vidar New Member

    We solved it by modifying the code in __swift/library/User/class.SWIFT_User.php.

    Locate the "Authenticate" function (line 1326 in my revision of the file).
    Find the line with call to Loginshares autenticate function:
    return $_SWIFT_LoginShareUserObject->Authenticate($_email, $_userPassword, SWIFT::Get('IP'));

    Change it to:
    if($_SWIFT_LoginShareUserObject->Authenticate($_email, $_userPassword, SWIFT::Get('IP'))) return true;

    If loginshare returns false (user not authenticated) nothing will be done, and code will continue to regular login below:
    // Fallback to normal authentication if not enabled
  4. Adcom

    Adcom New Member

    I am sorry if this is a very basic question, but when I went to the path and opened the php file it looked like it was encrypted. I would really like to get this to work as the other solution work around with groups and such is confusing. Am I opening it wrong? I just used notepad for it.

    Thank you....
  5. Vidar

    Vidar New Member

    You need the open version of Kayako.
    Our downloaded package is named "fusion_stable_ioncubeopen_4_40_986.tar.gz", I guess the other one has "closed" in its name..
  6. Adcom

    Adcom New Member

    Thank you, you wouldn't know if there is any adverse effects if I just used the open file with my closed? It's good thing I am in trial still but hate to set it all up again. Thanks again.....
  7. Drew Keller

    Drew Keller Just one person in a world of millions.

    I think you will find that this files encrypted in the trail version only, once you buy your license you get access to the unencrypted files.
  8. Adcom

    Adcom New Member

    That makes sense Drew. Thank you very much again to everyone.
  9. Joereal

    Joereal New Member

    Hello can you help me on login share process
    How can I use the login function in class.Controller_User.php under __swift\modules\base\client to be called in my wordpress ?
    Please help me...
    Thank you.
  10. Vidar

    Vidar New Member

    I'm sorry. I do not know how to do that.
    (If I understand correctly, you want to use kayakos login function on wordpress?)
  11. Andriy Kharkovyy

    Andriy Kharkovyy New Member

    This works nice thank you!
  12. HannesD

    HannesD New Member

    Briljant article. Thanks
  13. Torbjörn S.

    Torbjörn S. Reputed Member

    I cant get this working 0n 4.51.1891
    Is there any changes to the code that I am missing?
  14. Torbjörn S.

    Torbjörn S. Reputed Member

    Ignore this!!
    A tips for everyone:
    If you have more than one testenvironment, be sure to edit files in the right one. If you do that everything will work. :oops:

  15. mopwr

    mopwr New Member

    Works great, I hope this is added as a feature.

    Note that in version 4.53.2633 the file is located in __swift\apps\base\models\User\
  16. Niklas Huss

    Niklas Huss New Member

    How do I do this for staff?
    I want to have a fallback to the kayako manually added staff since not all my staff is in my domain.
  17. Niklas Huss

    Niklas Huss New Member

    I have tried to add
    if($_loginShareResult) return true;
    insted of
    return $_loginShareResult;
    in function Authenticate in __swift\apps\base\models\Staff\class.SWIFT_Staff.php but then Im not allowed to login on the admin page...
  18. Eric Van Tol

    Eric Van Tol Member

    I would also like to know how I can allow specific staff accounts to bypass the Loginshare AD process and use the Kayako DB for authentication.
  19. Gary McGrath

    Gary McGrath Staff Member

    In the file mentioned above ( class.SWIFT_Staff.php )

    Look for the line: if ($_shouldBeAdmin && !$_loginShareResult)

    and change it to: if (!$_loginShareResult)

    That should allow staff to fall back to Kayako DB accounts if loginshare does not find a match

    Eric Van Tol likes this.
  20. Eric Van Tol

    Eric Van Tol Member

    That did it, thanks!

Share This Page