# Using Discourse API to return user data when the "Require authentication to read content on this site, disallow anonymous access." setting is checked

**URL:** <https://meta.discourse.org/t/using-discourse-api-to-return-user-data-when-the-require-authentication-to-read-content-on-this-site-disallow-anonymous-access-setting-is-checked/28404>\
**Category:** Bug\
**Tags:** rest-api\
**Created:** [06.Май.2015 22:11:49 UTC](https://meta.discourse.org/t/using-discourse-api-to-return-user-data-when-the-require-authentication-to-read-content-on-this-site-disallow-anonymous-access-setting-is-checked/28404 "2015-05-06T22:11:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [09.Май.2015 04:12:17 UTC](https://meta.discourse.org/t/using-discourse-api-to-return-user-data-when-the-require-authentication-to-read-content-on-this-site-disallow-anonymous-access-setting-is-checked/28404/3 "2015-05-09T04:12:17Z")

</div>

You’ll need to authenticate/log in to make that request. One way to authenticate is to supply a `api_key` and `api_username`, which sounds like what you want here. (The other way is to store `Cookie`s.)

---

_[View the full topic](https://meta.discourse.org/t/using-discourse-api-to-return-user-data-when-the-require-authentication-to-read-content-on-this-site-disallow-anonymous-access-setting-is-checked/28404)._
