{"id":317429,"date":"2026-06-03T10:36:47","date_gmt":"2026-06-03T10:36:47","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/mksddn-reddy-auth\/"},"modified":"2026-06-03T10:36:36","modified_gmt":"2026-06-03T10:36:36","slug":"mksddn-reddy-auth","status":"publish","type":"plugin","link":"https:\/\/ru.wordpress.org\/plugins\/mksddn-reddy-auth\/","author":23351592,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.0","requires":"6.2","requires_php":"7.4","requires_plugins":null,"header_name":"MksDdn Reddy Auth","header_author":"mksddn","header_description":"Authentication plugin for Reddy bot OTP login in WordPress and REST API clients.","assets_banners_color":"","last_updated":"2026-06-03 10:36:36","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/mksddn\/WP-MksDdn-Reddy-Auth","header_author_uri":"https:\/\/github.com\/mksddn","rating":0,"author_block_rating":0,"active_installs":0,"downloads":31,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"mksddn","date":"2026-06-03 10:36:36"}},"upgrade_notice":[],"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[710,602,9210,23853],"plugin_category":[38],"plugin_contributors":[247396],"plugin_business_model":[],"class_list":["post-317429","plugin","type-plugin","status-publish","hentry","plugin_tags-authentication","plugin_tags-login","plugin_tags-otp","plugin_tags-rest-api","plugin_category-authentication","plugin_contributors-mksddn","plugin_committers-mksddn"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/mksddn-reddy-auth.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>MksDdn Reddy Auth provides OTP-based authentication with:<\/p>\n\n<ul>\n<li>WordPress cookie session login for the frontend (shortcode, or REST with <code>issue_session: true<\/code>).<\/li>\n<li>Optional Bearer token issuing for REST clients (<code>issue_token: true<\/code>; cookie not set by default on REST login).<\/li>\n<li>Rate limiting and one-time OTP verification.<\/li>\n<li>Optional site and REST API protection for unauthenticated visitors.<\/li>\n<li>Optional allowed request sources (Origin\/Referer) for plugin REST endpoints.<\/li>\n<\/ul>\n\n<p>The plugin maps each Reddy ID to a WordPress user and can create an account automatically on first successful login.<\/p>\n\n<h3>Getting Started<\/h3>\n\n<h4>1. Configure the Reddy bot token<\/h4>\n\n<p>For production, define the token in <code>wp-config.php<\/code>:<\/p>\n\n<pre><code>define( 'MKSDDN_REDDY_BOT_TOKEN', 'your-bot-token' );\n<\/code><\/pre>\n\n<p>For local development you can store the token in <strong>Settings &gt; Reddy Auth<\/strong> instead. Use <strong>Bot connection test<\/strong> to verify delivery to a Reddy user.<\/p>\n\n<h4>2. Set up the login page<\/h4>\n\n<p>Create a WordPress page (for example, <code>\/login\/<\/code>) and insert:<\/p>\n\n<pre><code>[mksddn_reddy_login]\n<\/code><\/pre>\n\n<p>Users enter their Reddy ID, receive a one-time code in Reddy, and sign in through the form.<\/p>\n\n<h4>3. Review protection settings<\/h4>\n\n<p>By default, both protection options are <strong>disabled<\/strong> so your site stays accessible after activation. Enable them only after the login page is configured:<\/p>\n\n<ul>\n<li><strong>Protect site content<\/strong> \u2014 redirects unauthenticated visitors to the login page.<\/li>\n<li><strong>Protect all REST API content<\/strong> \u2014 returns <code>401<\/code> for protected REST routes.<\/li>\n<\/ul>\n\n<p>Public auth routes remain available without login:<\/p>\n\n<ul>\n<li><code>POST \/wp-json\/mksddn-reddy-auth\/v1\/auth\/send-code<\/code><\/li>\n<li><code>POST \/wp-json\/mksddn-reddy-auth\/v1\/auth\/login<\/code><\/li>\n<\/ul>\n\n<h4>4. Use REST API for headless clients<\/h4>\n\n<p>Typical flow:<\/p>\n\n<ol>\n<li><code>POST \/auth\/send-code<\/code> with <code>{ \"reddy_id\": \"123456\" }<\/code><\/li>\n<li><code>POST \/auth\/login<\/code> with <code>{ \"reddy_id\": \"123456\", \"code\": \"111111\", \"issue_token\": true }<\/code> for headless clients. Add <code>\"issue_session\": true<\/code> only when the browser must also receive a WordPress cookie (same-origin SPA).<\/li>\n<li>Call protected REST routes with <code>Authorization: Bearer &lt;token&gt;<\/code>.<\/li>\n<li><code>GET \/auth\/me<\/code> to read the current user (Bearer or cookie session).<\/li>\n<li><code>POST \/auth\/logout<\/code> to end the cookie session and revoke the Bearer token when provided.<\/li>\n<\/ol>\n\n<p><strong>Protect site content<\/strong> checks the WordPress cookie session (shortcode login or REST login with <code>issue_session: true<\/code>). It does not accept Bearer tokens. <strong>Protect all REST API content<\/strong> requires a Bearer token and ignores cookie-only sessions.<\/p>\n\n<p>Download OpenAPI and Postman files from <strong>Settings &gt; Reddy Auth &gt; Developer Resources<\/strong>.<\/p>\n\n<h4>5. Optional: restrict REST callers by browser source<\/h4>\n\n<p>In <strong>Settings &gt; Reddy Auth<\/strong>, <strong>Allowed request sources<\/strong> limits plugin REST traffic (<code>\/mksddn-reddy-auth\/v1\/*<\/code>) to listed <code>Origin<\/code> or <code>Referer<\/code> URLs. Leave empty to allow any client (recommended for server-to-server integrations). This is a soft guard for browser apps, not a secret key.<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin connects to the <strong>Reddy bot API<\/strong> at <code>https:\/\/bot.reddy.team<\/code> to deliver one-time passwords and optional admin connection test messages.<\/p>\n\n<p><strong>What the service is used for<\/strong><\/p>\n\n<ul>\n<li>Deliver OTP codes to a Reddy user during login.<\/li>\n<li>Send an optional admin \"bot connection test\" message from <strong>Settings &gt; Reddy Auth<\/strong>.<\/li>\n<\/ul>\n\n<p><strong>What data is sent and when<\/strong><\/p>\n\n<ul>\n<li><strong>OTP send \/ login:<\/strong> Reddy user ID (<code>userKey<\/code>) and message text containing the one-time code (and expiry hint). Message text is configurable in <strong>Settings &gt; Reddy Auth &gt; Bot Messages<\/strong> (placeholders <code>{code}<\/code>, <code>{ttl}<\/code>). Sent when a user requests a code via the login form or REST API.<\/li>\n<li><strong>Bot connection test:<\/strong> Reddy user ID (<code>userKey<\/code>) and a configurable test message from <strong>Settings &gt; Reddy Auth &gt; Bot Messages<\/strong>. Sent only when an administrator runs <strong>Bot connection test<\/strong> in <strong>Settings &gt; Reddy Auth<\/strong>.<\/li>\n<li><strong>Bot token:<\/strong> Your bot token is included in the API request URL path (configured via <code>MKSDDN_REDDY_BOT_TOKEN<\/code> in <code>wp-config.php<\/code> or the development fallback field in settings). It is not sent to WordPress.org.<\/li>\n<\/ul>\n\n<p>Data is transmitted only when OTP delivery or the connection test is triggered. The plugin does not send site content, post data, or WordPress user passwords to Reddy.<\/p>\n\n<p>This service is provided by Reddy: terms of use and privacy policy at https:\/\/help.reddy.team\/pages\/user-agreement<\/p>\n\n<p>No other third-party services are required for core plugin operation.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Open <strong>Settings &gt; Reddy Auth<\/strong> and configure bot token and security options.<\/li>\n<li>Create a login page and add the shortcode <code>[mksddn_reddy_login]<\/code>.<\/li>\n<li>If site protection is enabled, select that page in the <strong>Login page<\/strong> setting.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"where%20should%20i%20store%20the%20bot%20token%3F\"><h3>Where should I store the bot token?<\/h3><\/dt>\n<dd><p>Use the <code>MKSDDN_REDDY_BOT_TOKEN<\/code> constant in <code>wp-config.php<\/code> on production sites. The settings page field is a development fallback and should not replace secure server-side configuration in live environments.<\/p><\/dd>\n<dt id=\"why%20am%20i%20stuck%20in%20a%20redirect%20loop%3F\"><h3>Why am I stuck in a redirect loop?<\/h3><\/dt>\n<dd><p>This usually happens when <strong>Protect site content<\/strong> is enabled but no valid login page is selected. Create a page with <code>[mksddn_reddy_login]<\/code>, choose it in <strong>Login page<\/strong>, and save settings.<\/p><\/dd>\n<dt id=\"does%20this%20plugin%20replace%20%60%2Fwp-login.php%60%3F\"><h3>Does this plugin replace `\/wp-login.php`?<\/h3><\/dt>\n<dd><p>No. It adds a Reddy OTP login flow via shortcode and REST endpoints. Standard WordPress login may still be available unless you restrict it separately.<\/p><\/dd>\n<dt id=\"are%20wordpress%20users%20created%20automatically%3F\"><h3>Are WordPress users created automatically?<\/h3><\/dt>\n<dd><p>Yes. On first successful OTP login the plugin creates a WordPress user mapped to the Reddy ID and stores the mapping in user meta.<\/p><\/dd>\n<dt id=\"how%20do%20rest%20clients%20authenticate%3F\"><h3>How do REST clients authenticate?<\/h3><\/dt>\n<dd><p>Send <code>issue_token: true<\/code> in the login request, then pass the returned token in the <code>Authorization: Bearer<\/code> header. REST login does <strong>not<\/strong> set a WordPress cookie unless you also send <code>issue_session: true<\/code>. Use the login shortcode or <code>issue_session: true<\/code> when the browser needs access to <strong>Protect site content<\/strong> pages.<\/p><\/dd>\n<dt id=\"what%20is%20the%20difference%20between%20issue_token%20and%20issue_session%3F\"><h3>What is the difference between issue_token and issue_session?<\/h3><\/dt>\n<dd><p>issue_token returns a Bearer token for REST API clients. <code>issue_session<\/code> sets the WordPress auth cookie. Shortcode login always sets a cookie. REST login sets a cookie only when <code>issue_session<\/code> is true (default false). Headless integrations should use <code>issue_token<\/code> without <code>issue_session<\/code> so site content stays locked until an explicit cookie login.<\/p><\/dd>\n<dt id=\"what%20happens%20when%20an%20administrator%20deletes%20a%20reddy%20user%3F\"><h3>What happens when an administrator deletes a Reddy user?<\/h3><\/dt>\n<dd><p>All plugin Bearer tokens for that WordPress user are revoked and WordPress session tokens are destroyed. The user must complete OTP login again. Deleting the WordPress account does not permanently block the Reddy ID; a successful OTP login can recreate the account.<\/p><\/dd>\n<dt id=\"why%20do%20i%20get%20http%20429%3F\"><h3>Why do I get HTTP 429?<\/h3><\/dt>\n<dd><p>The plugin rate-limits OTP send and login attempts per Reddy ID and client IP. Wait for the limit window to expire or adjust limits in <strong>Settings &gt; Reddy Auth<\/strong>.<\/p><\/dd>\n<dt id=\"what%20does%20allowed%20request%20sources%20do%3F\"><h3>What does Allowed request sources do?<\/h3><\/dt>\n<dd><p>It optionally checks <code>Origin<\/code> or <code>Referer<\/code> on plugin REST routes only. Empty list = no restriction (default). Non-empty list = browser apps must call from a listed URL. It does not replace OTP, rate limits, or Bearer auth\u2014headers can be spoofed.<\/p><\/dd>\n<dt id=\"why%20do%20i%20get%20http%20403%20with%20%22request%20not%20allowed%20from%20this%20source%22%3F\"><h3>Why do I get HTTP 403 with \"Request not allowed from this source\"?<\/h3><\/dt>\n<dd><p><strong>Allowed request sources<\/strong> is configured and the request has no matching <code>Origin<\/code>\/<code>Referer<\/code>. Add your frontend URL to the list, send a matching <code>Origin<\/code> header from server clients, leave the list empty for backends, or use the <code>mksddn_reddy_is_request_url_allowed<\/code> filter.<\/p><\/dd>\n<dt id=\"which%20data%20does%20the%20plugin%20store%3F\"><h3>Which data does the plugin store?<\/h3><\/dt>\n<dd><p>Settings in WordPress options, Reddy ID mapping in user meta, Bearer token hashes in a custom database table, and OTP\/rate-limit state in transients. Raw OTP codes and raw tokens are not stored.<\/p><\/dd>\n<dt id=\"what%20happens%20on%20uninstall%3F\"><h3>What happens on uninstall?<\/h3><\/dt>\n<dd><p>If uninstall cleanup runs, plugin-owned options, user meta, custom tables, and transients are removed according to <code>uninstall.php<\/code>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Do not require Bearer on HTTP OPTIONS when REST API content lock is enabled (CORS preflight for cross-origin SPAs).<\/li>\n<li>Stable 1.0.0 release.<\/li>\n<\/ul>\n\n<h4>0.1.4<\/h4>\n\n<ul>\n<li>Admin settings for bot message texts: OTP template ({code}, {ttl}) and connection test message.<\/li>\n<li>Filter <code>mksddn_reddy_otp_message<\/code> still overrides the final OTP text after the admin template is applied.<\/li>\n<li>Filter <code>mksddn_reddy_bot_test_message<\/code> for customizing the connection test message.<\/li>\n<\/ul>\n\n<h4>0.1.3<\/h4>\n\n<ul>\n<li>REST login no longer sets a WordPress cookie by default. Optional <code>issue_session<\/code> parameter (default false); use <code>issue_token<\/code> for Bearer auth. Shortcode login still sets a cookie.<\/li>\n<li><strong>Protect site content<\/strong> uses cookie sessions only; <strong>Protect all REST API content<\/strong> requires Bearer tokens. Documented split between monolith and REST protection.<\/li>\n<li>Revoke all Bearer tokens and destroy WordPress sessions when a WordPress user is deleted.<\/li>\n<li>Bearer token validation requires an active <code>_mksddn_reddy_id<\/code> user meta mapping.<\/li>\n<li>Site and REST content lock: WP staff with <code>edit_posts<\/code> (administrator, editor) bypass Reddy-only lock without OTP.<\/li>\n<li>Filter <code>mksddn_reddy_content_lock_bypass<\/code> to customize lock bypass per user.<\/li>\n<li>More reliable login page detection for monolith content lock (configured page, URL path, shortcode fallback).<\/li>\n<li>REST content lock respects existing authentication errors before enforcing Reddy check.<\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Direct Reddy terms of use and privacy policy links in External services readme section.<\/li>\n<li>Require cookie session or Bearer token authentication for POST <code>\/auth\/logout<\/code> REST endpoint.<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li><strong>External services<\/strong> disclosure in readme for Reddy bot API (OTP delivery).<\/li>\n<li>Safer defaults: site and REST protection disabled until explicitly enabled in settings.<\/li>\n<li>Monolith content lock skipped until a login page or shortcode page is configured.<\/li>\n<li>Admin setup notice after activation pointing to <strong>Settings &gt; Reddy Auth<\/strong>.<\/li>\n<li>Uninstall cleanup removes plugin-owned transients (OTP and rate-limit state).<\/li>\n<li>Optional <strong>Allowed request sources<\/strong> for plugin REST endpoints (Origin\/Referer allowlist, HTTP 403 when mismatched).<\/li>\n<li>Updated plugin metadata (GitHub URIs, license, WordPress and PHP requirements).<\/li>\n<li>Tested up to WordPress 7.0.<\/li>\n<li>Hardened REST middleware: sanitize request URI before route checks.<\/li>\n<li>Clearer rate limit labels and field descriptions in settings.<\/li>\n<li>Improved uninstall cleanup and WPCS compliance across core files.<\/li>\n<li>Removed redundant textdomain loader (WordPress auto-loads plugin translations).<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial MVP release.<\/li>\n<\/ul>","raw_excerpt":"Authenticate WordPress users via Reddy OTP flow for monolith and REST API clients.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/317429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=317429"}],"author":[{"embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mksddn"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=317429"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=317429"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=317429"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=317429"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=317429"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ru.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=317429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}