Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • ****Sorry “[email protected]” when installing WP should be “–[email protected]

    Okay let’s start with a fresh install of WP. I’m using wp-cli found at https://wp-cli.org/

    Download WP
    wp core download

    Setup the config file
    wp core config --dbname=wp_cli --dbuser=root --dbpass=A123456

    Install WP
    wp core install --url=pathToYourWPDir --title=WP-CLI --admin_user=admin --admin_password=A123456 [email protected]

    Now jump into the plugins dir
    cd somePath/wp-content/plugins

    We need to install the api server
    git clone [email protected]:WP-API/WP-API.git

    Now it’s time to install the Basic Auth
    git clone https://github.com/WP-API/Basic-Auth.git

    Go ahead and install OAuth1
    git clone [email protected]:WP-API/OAuth1.git

    We have to enable everything by logging into the admin dashboard.
    Under plugins activate JSON REST API then JSON Basic Authentication and OAuth Server. Remember for the REST API to work you have to have Permalinks setup. I always just use Post name.

    From what I’ve read you have to log out before the Basic Auth will work. Not sure if that is true or not have not tested it yet.

    So for the fun stuff let’s make a log file and watch it.
    touch logs.txt && watch -n 1 cat logs.txt

    Open up another terminal and use curl to hit the endpoint. *Note you need to be in the same dir that you made the logs.txt
    curl -s --user admin https://somePathToYourWpSite/wp-json/wp/users/me -o "logs.txt"

    Type in your password and watch the magic happen.

    Good luck ??

    Just got it working but not with this plugin. I’ll post a how to later today. Victory!

    Just got it working but not with this plugin. I’ll post a how to later today. Victory!

    Just got it working but not with this plugin. I’ll post a how to later today. Victory!

    I’m on day two still nothing. ??

    I’ve tried everything trick I know of and your solutions but, just can not get pass this

    * Hostname was NOT found in DNS cache
    *   Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 80 (#0)
    * Server auth using Basic with user 'admin'
    > GET /wordpress/wp-json/users/me HTTP/1.1
    > Authorization: Basic YWRtaW46QmFzaWMuNTc=
    > User-Agent: curl/7.35.0
    > Host: localhost
    > Accept: */*
    >
    < HTTP/1.1 401 Unauthorized
    < Date: Sat, 27 Dec 2014 05:00:38 GMT
    * Server Apache/2.4.9 (Ubuntu) is not blacklisted
    < Server: Apache/2.4.9 (Ubuntu)
    < X-Powered-By: PHP/5.5.11-3+deb.sury.org~saucy+1
    < X-Pingback: https://localhost/wordpress/xmlrpc.php
    < X-Content-Type-Options: nosniff
    < Access-Control-Allow-Origin: *
    < Content-Length: 76
    < Content-Type: application/json; charset=UTF-8
    <
    { [data not shown]
    * Connection #0 to host localhost left intact

    Guess I’ll move on to the OAuth then ?? Feeling a bit defeated

Viewing 7 replies - 1 through 7 (of 7 total)