3rd Party Authentication

3rd Party Authentication is a wordpress plugin that allows wordpress to authenticate against other authentication systems. These include:

  • Gmail / Google Apps
  • Any generic POP/IMAP email service
  • http://wordpress.org/extend/plugins/3rd-party-authentication/

    Known Issues
    There is a known issue related to the google login, sometimes it requires the user to enter a captcha (one of those pattern of fuzzy letters), especially if a user types the wrong password. At the moment the plugin doesn’t handle this, and may stop the user using this service. You can fix this by going here: https://www.google.com/accounts/DisplayUnlockCaptcha

    Change log
    0.2.3
    Fix so auto creating users populates email field allowing more than on user to be created! Thanks Cody!
    0.2.2
    Added text on login page to indicated regular logins work
    0.2.1
    Bug fix for when using default port
    0.2.0
    Remove blank from the list in 0.1.7
    0.1.9
    Fix for if wp_authenticate already declared
    0.1.8
    Added google apps domains to the list
    0.1.7
    Shows a list of domains that can be logged in using
    0.1.6
    Can now auto create users


    Reader Comments

    1. As far as I can read, your plugin seems to be the perfect match for my need. BUT do you know, if it works with WPMU 2.7? And if not, any ideas what is needed to get it to work?

      (I have some projects, where I can use this plugin, so if interested, I can test it on my WPMU installations and surely will donate you for the work!)

    2. Hey,
      I’ve tried an initial version that should support WPMU. Give it a try here, and let me know if it works: http://downloads.wordpress.org/plugin/3rd-party-authentication.0.1.4.zip

      Also, in order to add logins with a @gmail.com address you’ll need to change the pregmatch in wp-includes/wpmu-functions.php on Line 897 (in wpmu 2.7) from:

      preg_match( “/[a-z0-9\]+/”, $user_name, $maybe );

      to:

      preg_match( “/[a-z0-9@\\.]+/”, $user_name, $maybe );

    3. I just installed this into a fresh 2.7.1 installation and I’m not getting anything. I activated it, then went to the settings under 3rd Party Authentication (left all of that blank?). Is there something that I’m missing? My way of testing is just entering my email address (gmail) and password and it’s giving me a “invalid login” error. I did the clear captcha thing and I still got nothin’. New to WordPress, but not to PHP and web development. Let me know. Thanks!

      –Andrew

    4. Hi,
      errorwindow after login with googlemail password: – “Username not an email address”

      any idea?

    5. The current version of the plugin requires that you login and that the facebook username is set to the full @gmail.com or @googlemail.com email address.

    6. I understand. I’ve always got both Facebook and Google going through my mind and tend to get them mixed up.

      One last question just for clarification: by activating this plug-in my users that have an @gmail.com or @googlemail.com will be authenticating using their Google Password, right? All my other users will be treated normally, right?

    7. I installed this on a new site i am setting up and receiving the following error when I try to activate:Fatal error: Cannot redeclare class HTTPRequest in /home/ninedrag/public_html/jiulongpai.com/wp-content/plugins/3rd-party-authentication/httplib.php on line 12

      Any ideas?

    8. I am not able to set this up with WordPress 2.7.1. Is it known to work with this version? If so, does it work with Google Apps for your Domain? Any help would be greatly appreciated.

    9. CyberSNAC
      You must set up users in wordpress to have the user name the same as your full email address. I’ll have a look at testing on 2.8.4 soon

      dghant
      use FTP or the file manager of your hosting to delete the plugin so that you can login again. I’ll try get a version up that permits the admin to authenticate normally

    10. Thanks James,

      I have another question , of course.
      would you happen to have the
      DNS’s and port for authenticated
      against hotmail, AOL and yahoo’s IMAP ??

      So we can provide authentication there too???

    11. James,

      So I have to register a user account for a user with their full @gmail.com address as their username and match their password as well?

      I was thinking I could just have a user log in using their gmail.com credentials without having to have a user in place already.

      the way I understand you are telling me this works, I would have to get the users to register on the site using the same credentials set that they use for gmail, prior to them actually being able to log into my site with their gmail.com credentials.

      Is this correct? Thanks again :)

    12. CyberSNAC
      You have to have the user already added to your blog, this is because you might want certain permissions for a user (editor/admin) and not just subscriber. Once you’ve done that, it authenticates the password against google, so if the user changes their password on google they will automatically just use their new password on your wordpress blog.

      I see what you mean about not adding users though if you just want them to be able to comment. I can add this as an option, that they just get the subscriber role.

    13. James,

      I think this plugin has alot of potential. I don’t like some of the other 3rd party plugins because they are too bulky. This one seems to be able to do it’s thing without having to add any major content to the login widget or page. I like streamlined.

      I’d like to see the plugin be able to register people using their google credentials with a default role of subscriber. I could then elevate their priveleges as I see fit. Can that be done?

    14. James,

      When I tried installing the 3rd part authentication on my WordPress 2.8.4, it was giving this error
      “Parse error: parse error, unexpected T_CLASS in /blog1/wp-content/plugins/3rd-party-authentication/3rd-party-authentication.php on line 14”
      Please help me on this.

    15. Hi James,
      Getting a plugin activate error with 0.1.8:
      Cannot redeclare wp_authenticate() (previously declared in /blahblah/wp-includes/pluggable.php:456) in /blahblah/wp-content/plugins/3rd-party-authentication/3rd-party-authentication.php on line 511
      Seem to get this with new installation from 0.16 upwards, 0.1.5 seems fine.
      Any ideas?
      Thanks
      YikYak

    16. Vinayak K
      – Not sure why that error is happening, the code should be syntax correct. I can only suggest trying the latest version.
      – There are two ways you can use yahoo logins. If the user is a UK user or a premium user and has POP3 mail access you can add the email address to the POP3 server access details to the list at the bottom of the plugin settings.
      – The other way is that you can sign up as a google user with yahoo email addresses, and add yahoo.com to the list of domains to authenticate as google logins in the long text box.

      YikYak
      – New version should fix that. That function is only required if you want users to be able to login on the fly, without going through the normal registration process.

    17. Yep its possible. Just add your google apps domain to the text box. You can also check the checkbox to remove the gmail.com and googlmail.com domains if required. Your usernames for wordpress need to be the full google apps emails.

    18. Hi James,

      I’ve just installed your plug in on 2.8.6 and get the following error when trying to activate:

      Parse error: parse error in C:\webroot\wp-content\plugins\3rd-party-authentication\3rd-party-authentication.php on line 14

      I’m a newbie to WordPress but reasonable experience with PHP and cannot figure out what is causing this error. Any help would be great

    19. I’ve not tried this plugin on windows, most people seem to use a linux distribution to run it. It could be that you’re using PHP 4 though?

    20. James, I’ve just found this great plugin. I need to authenticate users against another -private- authn service which offers an easy REST API to do it. Looking at the googleclientlogin.php code I’m figuring whether your 3rd party plugin is strictly linked to those predefined Google and email services or it would be extensible enough to use other services, maybe writing a similar myprivateclientlogin.php module to do that.
      Thanks!

    21. Hi,
      While there is no plugin system in the current version, it is very easily extended to add other services. The current version also support authentication my POP3 or IMAP to non-google domains.

      Let me know if you need any help modifying it. If you look at the code, you’ll see there is an authentication class you can inherit from, and then just add suitable logic to authenticate your domain against that authenticator.

    22. Hi James,
      Great plugin, just what I needed for my students who all have GoogleApps accounts. I noticed though that if I turn off “regular logins” then I cannot get in as admin. I think even on one blog I activated the plugin, did not set 3rdpartyauthentication options and got a default setup that kept me out as admin. Do you think there is any merit in having an option (or a default) to treat the admin user separately?
      Thanks
      YikYak

    23. Hmm, tricky, yes my user is “admin”. I’ve definitely been locked out of a couple of my blogs, and end up having to delete the plugin, do a lost password recovery upload and reactivate your plugin.

      The error meesgae I get when it all goes wonky is something like “user name is not a valid email address” if that helps, although even when I delete your plugin, I still have to do lost password recovery as well…perhaps something else is going wrong?

    24. I installed this on a new site i am receiving the following error when i try to login wiht a google apps account… Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.google.com:443 (Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?) in /home3/mailjour/public_html/wp-content/plugins/3rd-party-authentication/httplib.php on line 111

      Warning: fwrite(): supplied argument is not a valid stream resource in /home3/mailjour/public_html/wp-content/plugins/3rd-party-authentication/httplib.php on line 112

      Warning: fclose(): supplied argument is not a valid stream resource in /home3/mailjour/public_html/wp-content/plugins/3rd-party-authentication/httplib.php on line 116

    25. Hi James,

      Thanks for the gr8 plugin!

      After installing the plugin, the login window shows “login with your domain name address”

      Could you please advise on how to login with domain name to wordpress account.

    26. I can’t seem to get our wordpress to authenticate against our google apps account. I have tried every conceivable combination of settings, but could not get it to work. It looks pretty intuitive, but I might be missing something obvious.

    27. Hi James,

      We’re using your great plugin for Google Apps authentication. However, We’d like to create users without domainname included in the plugin.
      e.g. For [email protected], I’d like to create ‘username’ instead of usernameexample-com. Can you please help?
      If this problem is resolved, that would really help us a lot! If this is not possible, we’d need to request every member to register!! :(

      Please help..

      Thanks,
      Administrator,
      ECHO

    28. It is possible to do, but I need some time to update the plugin. I’m very busy at the moment so not sure when I’ll be able to.

    29. Hi James,

      The auto create users functionality does not work. Logging in and auto-creating the first user succeeds. Thereafter, it shows the error message “Invalid username”. What is actually happening is the user is not being added, because wp_create_user checks the email for uniqueness [through email_exists()] and that is returning the error “This email address is already registered.” This is true, because your login_failed method attempts to register all users with an empty (“”) email address. The first one succeeds, simply registering the user without an email address (whereas it should be the email/username with which they’re signing in). On the second and subsequent attempts, the empty email address (“”) is taken and adding the user fails. This can be fixed simply in your login_failed() function, by updating the call to wp_create_user from

      $user_id = wp_create_user( $username, $random_password, ”);

      to

      $user_id = wp_create_user( $username, $random_password, $username );

      Note that since this plugin requires the username to be an email address (whether google or not), then we specify the username as the email address as well when creating the user. (Nasty for data normalization purposes, and it means that the email used for login could be out-of-sync from the email which wordpress uses, but it works)

      You might also consider bubbling up the WP_Errors thrown from lower in the call stack and displaying more accurate answers. (Such as ‘Email already registered’ versus ‘Invalid username’)

      – Cody

      PS – If this isn’t too clear, I rewrote it as a narrative tutorial on my blog: http://codyaray.com/2010/08/wordpress-authentication-via-google-apps

    30. Ok thanks Code A. Ray, sorry it took me so long to fix this. I’ve been busy on so many things, and I didn’t realise it was such an easy fix!

      Its uploaded to the plugin directory version 0.2.3

    31. Just installed the current version 0.2.3 on a new WordPress 3.0.1 install. I can’t find “settings” for the plugin anywhere. I then logged out and was unable to log back in, so edited the php file to allow regular logins, but this appears to be ignored. Deleted the plugin folder to be able to get back in. Am I missing something obvious?

    32. *Bump* I’ve installed your authentication plugin after completely re-vamping my self-hosted wordpress site, and now I cannot login. Please tell me I do not have to reinstall the entire thing again! Help please!

    Write a Comment

    Your email address will not be published. Required fields are marked *

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.