Title: RSS authentication problem
Last modified: September 1, 2016

---

# RSS authentication problem

 *  [tbjornli](https://wordpress.org/support/users/tbjornli/)
 * (@tbjornli)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/rss-authentication-problem/)
 * We’re experiencing a problem accessing the RSS feed when the plugin is enabled
   and the sites visibility is set to visible only for registered users or the administrator.
   
   When accessing the feed ([http://example.com/feed/](http://example.com/feed/))
   through a browser you’re prompted to insert the username and password twice.
 * This is a problem when trying to access the feed from curl or with file_get_contents()
   in PHP.
 * I’ve been able to replicate the problem on a clean WordPress installation and
   below are som header output from curl:
 * Without the plugin enabled:
 *     ```
       $ curl -I http://wordpress.domain.dev/feed/
       HTTP/1.1 200 OK
       Date: Mon, 22 Aug 2016 08:24:02 GMT
       Server: Apache/2.4.18 (Ubuntu)
       X-Pingback: http://wordpress.domain.dev/xmlrpc.php
       Last-Modified: Mon, 28 Sep 2015 17:04:09 GMT
       ETag: "7e7f82da70bcfd2f08ba739248106f1d"
       Content-Type: text/html; charset=UTF-8
       ```
   
 * With the plugin enabled and visibility set to registered users or the administrator:
 *     ```
       $ curl -u "admin:password" -I http://wordpress.domain.dev/feed/
       HTTP/1.0 401 Unauthorized
       Date: Mon, 22 Aug 2016 08:24:12 GMT
       Server: Apache/2.4.18 (Ubuntu)
       X-Pingback: http://wordpress.domain.dev/xmlrpc.php
       Last-Modified: Mon, 28 Sep 2015 17:04:09 GMT
       ETag: "7e7f82da70bcfd2f08ba739248106f1d"
       Set-Cookie: wordpress_41193cf728d4d7b51d01f6c22f880058=admin%7C1473063853%7ConSnJR8ce7ICpqzCyJKy5BZQYyLazVA5DDguZDwjgaS%7Cf4a0623ef9593e7b3554e77a68787dcc21473eff9eea4bfcaeb6590cfee85889; expires=Mon, 05-Sep-2016 20:24:13 GMT; Max-Age=1252800; path=/wp-content/plugins; HttpOnly
       Set-Cookie: wordpress_41193cf728d4d7b51d01f6c22f880058=admin%7C1473063853%7ConSnJR8ce7ICpqzCyJKy5BZQYyLazVA5DDguZDwjgaS%7Cf4a0623ef9593e7b3554e77a68787dcc21473eff9eea4bfcaeb6590cfee85889; expires=Mon, 05-Sep-2016 20:24:13 GMT; Max-Age=1252800; path=/; HttpOnly
       Set-Cookie: wordpress_logged_in_41193cf728d4d7b51d01f6c22f880058=admin%7C1473063853%7ConSnJR8ce7ICpqzCyJKy5BZQYyLazVA5DDguZDwjgaS%7C30852dc698dfdfa76729a3b9f0f90a2ac271c19bb09104fcef42d298b6c8921e; expires=Mon, 05-Sep-2016 20:24:13 GMT; Max-Age=1252800; path=/; HttpOnly
       WWW-Authenticate: Basic realm="wordpress.domain.dev"
       Connection: close
       Content-Type: text/html; charset=UTF-8
       ```
   
 * [https://wordpress.org/plugins/more-privacy-options/](https://wordpress.org/plugins/more-privacy-options/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [tbjornli](https://wordpress.org/support/users/tbjornli/)
 * (@tbjornli)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/rss-authentication-problem/#post-7690101)
 * The reason for the problem is that [get_user_id_from_string](https://developer.wordpress.org/reference/functions/get_user_id_from_string/)
   has been deprecated.
 * Below is a fix that solves this problem.
 *     ```
       352c352
       < $user_id = is_wp_error( $user ) ? get_user_id_from_string( $user->user_login ) : null;
       ---
       > $user_id = $user->ID;
       ```
   
 * The if/else statement is unnecessary since it’s executed again on the next line
   of the code.
 *     ```
       $user_id = $user->ID;
   
       if ( is_wp_error( $user ) ||
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘RSS authentication problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/more-privacy-options.svg)
 * [More Privacy Options](https://wordpress.org/plugins/more-privacy-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/more-privacy-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/more-privacy-options/)
 * [Active Topics](https://wordpress.org/support/plugin/more-privacy-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/more-privacy-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/more-privacy-options/reviews/)

## Tags

 * [authentication](https://wordpress.org/support/topic-tag/authentication/)
 * [curl](https://wordpress.org/support/topic-tag/curl/)
 * [file_get_contents](https://wordpress.org/support/topic-tag/file_get_contents/)
 * [password](https://wordpress.org/support/topic-tag/password/)
 * [RSS](https://wordpress.org/support/topic-tag/rss/)

 * 1 reply
 * 1 participant
 * Last reply from: [tbjornli](https://wordpress.org/support/users/tbjornli/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/rss-authentication-problem/#post-7690101)
 * Status: not resolved