开发者 |
inpsyde
Bueltge nullbyte dnaber-de |
---|---|
更新时间 | 2022年11月24日 03:38 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.1 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
mod_setenvif
or mod_rewrite
(if you want to user HTTP authentication for feeds).
/wp-content/plugins/
directory.Plugins
menu in WordPress.
or use the installer via the back end of WordPress..htaccess
file. If mod_setenvif is available, add the following line to your .htaccess
:
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
Otherwise you need mod_rewrite to be enabled. In this case you have to add the following line to your .htaccess
:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
In a typical WordPress .htaccess
it all looks like:
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule . /index.php [L]
On a multisite installation:
BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule . index.php [L]
END WordPress
Settings
You can change the settings of Authenticator in Settings → Reading. The settings refer to the behavior of your blog's feeds. They can be protected by HTTP authentication (not all feed readers support this) or by an authentication token which is added to your feed URL as a parameter. The third option is to keep everything in place. So feed URLs will be redirected to the login page if the user is not logged in (send no auth-cookie).
If you using token authentication, you can show the token to the blog users on their profile settings page by setting this option.
HTTP Auth
Users can gain access to the feed with their username and password.
Token Auth
The plugin will generate a token automatically when choosing this option. Copy this token and share it with the people who should have access to your feed. If your token is ef05aa961a0c10dce006284213727730
the feed URLs look like so:
Main feed
https://example.com/feed/?ef05aa961a0c10dce006284213727730
Main comment feed
https://example.com/comments/feed/?ef05aa961a0c10dce006284213727730
Without permalinks
https://example.com/?feed=rss2&ef05aa961a0c10dce006284213727730
API
Filters
authenticator_get_options
gives you access to the current authentication token:authenticator_bypass
gives you the possibility to completely bypass the authentication. No authentication will be required then.authenticator_bypass_feed_auth
gives you the possibility to open the feeds for everyone. No authentication will be required then.authenticator_exclude_pagenows
Pass an array of $GLOBALS[ 'pagenow' ]
values to it, to exclude several WordPress pages from redirecting to the login page.authenticator_exclude_ajax_actions
AJAX-Actions (independend of _nopriv
) which should not be authenticated (remain open for everyone)authenticator_exclude_posts
List of post-titles which should remain public, like the follow example source to public the 'Contact'-page.authenticator_bypass
, see the readme.XMLRPC_REQUEST
.$reauth
for redirect #11.