The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Are there hooks for webmail logins?

Discussion in 'cPanel Developers' started by Luke1818, Sep 15, 2015.

  1. Luke1818

    Luke1818 Registered

    Joined:
    Sep 15, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Singapore
    cPanel Access Level:
    Root Administrator
    Hi,

    I am exploring the possibility of implementing 2FA for webmail logins. What I need to achieve is run some custom code after a user logs in via the Webmail page, to perform additional authentication (like keying in an OTP etc).

    Is there some hook where I can run some actions after a user has logged in with the password?

    This is the closest solution I found: github.com/steadramon/cpanel_addon-twostepauth
    BUT it works only for cPanel users, and not for email user accounts..
     
    #1 Luke1818, Sep 15, 2015
    Last edited by a moderator: Sep 16, 2015
  2. cPDavidN

    cPDavidN cPanel Developer
    Staff Member

    Joined:
    Mar 19, 2013
    Messages:
    42
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Hello,

    Unfortunately, we don't have hook points for webmail or cPanel logins. This would be a difficult place to add a hook, because cpsrvd would have to fork and drop privileges before executing the hook, but still block the login process. A hook that was implemented incorrectly could completely break cPanel & WHM in a way that very few other hooks could do. It would also introduce an unknown number of code dependencies into cpsrvd, increasing memory usage. I will make a request to find out if we can do it, but please understand that it may not be possible.

    Thanks,

    David Nielson
    Integration Developer, cPanel
     
Loading...

Share This Page