We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9122
    • 27 Posts
    Hi All,

    After many years of singing the praises of MODX, I've finally been given the go ahead to build out some intranet sites with MODX. I'm trying to write a simple Active Directory authentication plugin. I was not able to get modActiveDirectory to work in our environment, but I have created a simple test snippet that will authenticate user credentials against AD and will return pass/fail values.

    Here's what I'm thinking for a plugin:
    1) Create authentication plugin and hook into OnManagerAuthentication and OnWebAuthentication system events.
    2) If AD authentication fails, continue and attempt to login to MODX as normal.
    3) If AD authentication is successful, log the user into the appropriate context "manager" or "web" without testing the password against the MODX database. This is where I'm having problems.

    I've read through the modUser API documentation, but I'm not sure how can I programatically log a user into a context without providing a password.

    Any help is greatly appreciated.