Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Restrict CRUD operations to authenticated users only #2432

Description

@MurhafSousli

Hi,
I would like to restrict CRUD operations to authenticated users only, I don't want anonymous users to access the site's contents, is this possible with WP-API?

Thank you

Activity

  1. danielbachhuber commented on Apr 12, 2016

    @danielbachhuber
    Member

    I don't want anonymous users to access the site's contents, is this possible with WP-API?

    Yes, see this code snippet: https://gist.github.com/danielbachhuber/8f92af4c6a8db784771c

  2. MurhafSousli commented on Apr 12, 2016

    @MurhafSousli
    Author

    Thank you

  3. MurhafSousli commented on Apr 15, 2016

    @MurhafSousli
    Author

    I'm always getting the following code on Postman extension

    {
      "code": "restx_logged_out",
      "message": "Sorry, you must be logged in to make a request.",
      "data": {
        "status": 401
      }
    }
    

    Is this because I'm accessing the RESTful service outside wordpress?

    if so what can be an alternative solution?

  4. BE-Webdesign commented on Apr 15, 2016

    @BE-Webdesign
    Member

    Is this because I'm accessing the RESTful service outside wordpress?

    Yes, you need to authenticate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions