I'm looking at using Wordpress as a small-scale CMS and would like to use our company's existing authentication system to manage users so that they don't have to remember yet another username or password.So far, I've got it set up so that users can authenticate to our company's system using WSDL/SOAP. A successful authentication returns a GUID, which I can then capture.I can get these GUIDs ahead of time and tie them to the user accounts in Wordpress. I was thinking that it would be fairly easy for me to have Wordpress check for an existing GUID session variable, compare it against the user database, and have the person set to be logged in as whichever user account the GUID matches to.I wanted to get feedback - is this a bad idea? Good idea? Suggestions?I'm familiar with the basics of Wordpress, but I wasn't sure exactly where to go once I've captured the GUID for comparison. I'm sure that I can figure it out with a enough reading of the codex and some poking around, but I was hoping for someone to point me in the right direction.Thanks!
8/10/2012 2:01:12 PM
write your own function and populate $current_userhttp://codex.wordpress.org/Function_Reference/get_currentuserinfo[Edited on August 10, 2012 at 2:24 PM. Reason : more importantly, populate the $user_ID global...i think]
8/10/2012 2:21:32 PM
if you're talking AD the objectGuid is nice becaue it wont change even if the user's first/last or login name changes. i would just make sure you arent exposing it to the browser/user via request parameters/cookie values since its kinda/sorta sensitive data.im sure you're all happy with your cool soap service (soap is really great and i love it), but as an alternative method of authentication you may want to see if wordpress supports SAML. If it does then you can install active directory federation services 2.0 as a SAML 2.0 Idenitity provider and set it up to provide the assertions you need for wordpress.if wordpress supports saml then the advantage is that you dont need to alter wordpress code to handle the authentication, downside is you'd need to spend a little bit learning saml and setup the idp (takes about an hour).also w/ saml you can use multiple IDPs so lets say you want users in another company to be able to access this (or maybe you do something w/ that requirement in the future) they can setup an IDP, you trust it, and then their users get to login with their existing creds in their own system. no external user credentials for you too manage! yippie![Edited on August 10, 2012 at 2:55 PM. Reason : f]
8/10/2012 2:53:21 PM
OpenID, man...OpenID
8/12/2012 1:45:36 AM
opensso
8/13/2012 8:14:38 AM
Thanks for the feedback! In the end, it was as simple as getting the GUID (response via SOAP authentication), using that to get the Wordpress ID of the user, and then using a combination of:get_userdata($wp_user_id)$wp_user = wp_set_current_user($wp_user_id)wp_set_auth_cookie($wp_user_id)in order to get Wordpress to identify the user as logged in.
if(!is_site_admin()) { // remove HTML tab}
if(!is_site_admin()) { // do not filter}
9/4/2012 9:35:34 AM