New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Plugin: Provide HTTP_AUTH Authentication for Piwik - Release in Marketplace #514
Comments
New in version 0.2:
Extract into plugins folder and activate via Settings | Plugins menu. |
Note: The AuthName from your .htaccess file is not passed to PHP. If you need to change the realm name, "Piwik" is hard-coded in plugins/HttpAuthLogin/Controller.php. |
Note: token_auth authentication is not available with this plugin |
A sample .htaccess file can be found in: http://forum.piwik.org/index.php?showtopic=4431 |
But I tested the updated plugin on the 1.0 branch, and it worked fine there. |
I've just had the time to try the HttpAuthLogin plugin with version 1.0. I logged in as administrator, enabled the plugin and when I reload the page it throws me back to the Piwik login screen. I previously authenticated with the webserver using a different username then administrator, but this username doesn't exist in Piwik. I tried clearing my HTTP auth information and then loading piwik again. I logged in to Apache again but this time Piwik falls into an infinite redirect loop. Can you give a brief description on how exactly to use this plugin? I use LDAP for authentication in Apache and usernames are user@domain.com. I tried manually creating a user account in Piwik to match my email address, but it wouldn't allow me to use the @ character in the username. Thanks, -Tim |
Tim: this plugin requires that you set up an .htaccess file and password file. In your case, shouldn't you be using #734? |
Replying to vipsoft:
For one, I'd prefer to stick with multi-layers of security: Password protect all of Piwik with Apache HTTP authentication (over SSL of course) while still having Piwik user accounts handle access control to the analytics data for each site. But I was hoping this plugin would pass along the credentials from HTTP authentication to Piwik. Isn't this what was intended? As for using the plugin for LDAP authentication, it seemed more complicated to setup and hasn't been updated in 13 months (maybe that just means it's working as expected). Since I already had Apache HTTP authentication setup using LDAP, I thought it would be easier to use the HTTP_AUTH plugin. -Tim |
That plugins works fairly well except one big things : the .htaccess breaks the API access with token_auth. How could it be made so it doesn't break the token_auth ? |
mmm, it seems that, as soon as you enable this plugin (even without any .htaccess file), the token_auth access is broken. (SitesManager.getSitesWithAdminAccess always returns an empty value) |
See #1766 for a patch to a possible bug in this plugin. |
Changelog:
|
Like Tim I also had the redirect loop problem. Auth.php:
... |
Changelog:
|
Attachment: v0.3.4 |
Changelog for 0.3.4
|
This should get listed in the list of plugins b/c this is very valuable for any enterprise organization. |
Maybe someone is running into similar problems: At first I couldn't get it to work with a clean PIWIK 1.7.1 install, because I always ran into a redirect loop problem, when I activated the plugin. After a lot of trial and error I found out that I have to deactivate the standard authentication and after that insert:
in the config/config.ini.php manually. It works now! |
I've found that not setting token auth upon authentication breaks some functionality as the superuser. So I wrote an updated version of Auth.php that sets the token_auth (instead of NULL) on successful authentication, and also replaces the Zend_Registry calls with the appropriate calls Piwik_config::getInstance() and Piwik_FetchOne. |
|
+1 following |
Hey. I added a rewrite for piwik 2.0. It seams to work for me but it may need a review. |
i keep getting Cannot access parent:: when current class scope has no parent in piwik/plugins/HttpAuthLogin2/Auth.php line 84 |
thx, I fixed this and another critical bug in db query |
@nougad thanks for your work on this. I was wondering, though, why did you choose to change Auth to implementing Core Auth instead of extending the Login plugin like the previous version? It seems like a lot of additional code for which you could simply fall back on the Login plugin instead. |
@drammons Do you mean I should extend the exiting Auth class instead of implementing the Auth interface? I had no real reason and your suggestion makes sense. I will change it that way. Thx |
Yes! That is exactly what I meant. Good work! |
I had to add: use Piwik\Common; ...to Auth.php to get this working. |
Attachment: Rewrite for piwik 2.0 |
@jarkko fixed - thx |
Heads up as ticket:4564 rolls out, adding support for multiple super users. |
Piwik 2.0.3 still tells me this plugin doesn't work Piwik. What am I doing wrong? |
@digantk - sure you used the HttpAuthLogin2.tgz file? Not the HttpAuthLogin.tgz one |
Replying to nougad:
I'm very sure. The directory is HttpAuthLogin2 and has the HttpAuthLogin2.php file in it and the error message in the plugin manager says HttpAuthLogin2. :-/ |
Along with the Piwik 2.0 release and new design for Piwik, we have also launched the official Plugins Marketplace to let any developer share their work to the thousands of Piwik users worldwide. Maybe you'd like to publish your plugin there? In any case, keep up the good work and we hope you enjoy Piwik 2! --> See also example of the Ldap plugin #734 published on the Marketplace at: http://plugins.piwik.org/LoginLdap |
Please add it to the marketplace. Without this plugin (and soon), I'll have lose the argument against Google Analytics and I'll have to drop the use of Piwik. |
Thanks for the suggestion. Indeed I think it makes sense that the Piwik team officially supports this important plugin. We will release it on the Marketplace soon, and will then officially support it going forward. |
In 5d49e72: Refs #514 Adding HttpAuth plugin as submodule, now hosted at: https://github.com/piwik/plugin-LoginHttpAuth |
Thanks for your patience! the HttpAuth login is now published on the Marketplace at: http://plugins.piwik.org/LoginHttpAuth please test it and report any issue in the Github issue tracker: https://github.com/piwik/plugin-LoginHttpAuth/issues Cheers! |
Plugin that forwards the current HTTP_AUTH’ed user to Piwik
```
```
It’s a plug-in that authentifies users based on HTTP_AUTH. HTTP_AUTH is a mechanism provided by the webserver itself (I tested this with Apache). The webserver prompts the user for a login and password, matches it to a database (or a file, you decide), and if the authentication is successful, it lets you access the current logged-in user from PHP.
```
```
If you have several web services running on the same machine, you can achieve Single Sign-On. For instance, if you run Piwik, a bug tracker, and a WebDAV disk space on the same web server, you could log-in once on the bug tracker, and be automagically logged-in on Piwik.
HTTP_AUTH is extremely widely supported. Even command-line tools like cURL or wget support it. If for some reason you’d like to write a script that fetches stuff out of Piwik, but you’d like it to be authentified, it’d be a lot easier to do with HttpAuthPlugIn.
Contributed by Romain Goyet.
Requires review per [wiki:CodingStandard].
Keywords: third-party-plugin
The text was updated successfully, but these errors were encountered: