• Resolved Paul Distel

    (@pauldistel)


    I have an isolated environment with it’s own Active Directory.

    I have succesfully implemented the plugin so users can authenticate using our companies SSO and a WordPress user is created at first login.

    What options do I have (maybe other plugins or additional code) to automaticly create an equivalent user object also in the Active Directory of the isolated environment once a user is logging in through SSO (with a random password of course but with the same username, email address, etc.)?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Hi @pauldistel,

    Thanks for the question.

    WP SAML Auth doesn’t directly interface with Active Directory, so I’m not sure of the best approach for your use case. It seems like it might be possible to call an Active Directory API to create the user?

    Sorry I can’t help further!

    Thread Starter Paul Distel

    (@pauldistel)

    I am not experienced enough with WordPress but I asume the plugin uses WordPress functions to create a new user but I don’t know if some function is called after a user is created?

    I am able to code some stuff myself but do not know where to insert a function. I can of course check with each page load if the current user exists in the backend active directory but that will cause a lot of unnecessary code to be executed every time again. Any suggestions where to start for me?

    • This reply was modified 3 years, 7 months ago by Paul Distel.
    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    I am not experienced enough with WordPress but I asume the plugin uses WordPress functions to create a new user but I don’t know if some function is called after a user is created?

    Yep! You can register a callback for the wp_saml_auth_new_user_authenticated action. Here’s a pseudo-code example:

    add_action(
    	'wp_saml_auth_new_user_authenticated',
    	function ( $user ) {
    		// Run whatever PHP code you need.
    	}
    );
    Thread Starter Paul Distel

    (@pauldistel)

    Thanks! I found the add_action function so you helped me out with this custom hook!

    Is there a list of hooks related to the plugin?

    • This reply was modified 3 years, 7 months ago by Paul Distel.
    • This reply was modified 3 years, 7 months ago by Paul Distel.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘SAML login in combination with AD’ is closed to new replies.