wp-api / api-console Goto Github PK
View Code? Open in Web Editor NEWAPI console for WP API
API console for WP API
If we can provide a modal/form to collect authentication data ( config.json ), we can use a hosted version on GitHub - that possibly uses cookies to store authentication - and thus anyone can use it without actually cloning/installing it.
The auth button doesn't don anything when clicked.
Hello,
Can anyone tell me where should I put api-console with my wordpress folder and activate it? I am trying to auth api not to public but only who has the key. Can anyone give me a direction how to do it? I have been stuck for few days...
Thank you
I get the following error:
Fatal error: Call to undefined function login_header() in ...wp-content/plugins/OAuth1/theme/oauth1-authorize.php on line 2
after I setup my config.json
file and hit "Auth" in the lower right hand corner of the console screen. First, a small window pops up and then I see this error. The URL at the moment of the error:
http://{myurl}/login?action=oauth1_authorize&oauth_callback=http%3A%2F%2F{myurl}%2Fapi%2Fapi-console%2Fland.html&oauth_token={atoken}
If I log out of my site and run it, I DO see a login screen, but as soon as I login (in this flow) I get that error. Seeing as how this error is being triggered on a path not "owned" by this plugin, I did some digging ... and confident it has something to do w/my using a custom login screen at the "/login" URL.
In summary, to recreate, enable "Theme My Login" plugin. Setup "/login" as your login page and URL.
I confirmed that if I disable the plugin, the authentication succeeds. But I still don't see anything in the viewer (which is likely a different issue). Even if it's beyond your control to "fix" perhaps there's a documentation update that can be made, since several folks use custom login screens. Thanks!
Hello,
I would like to report an issue related to requests requiring authorization / user logged in:
For example, using the console, with an admin user who previously authorized the application:
https://oauth1.wp-api.org/docs/basics/Signing.html
POST /wp-json/wp/v2/posts
title=Hello%20World
=> returns a 401 error, "Sorry, you are not allowed to create posts as this user."
The user ID is 0 and the expected ID is 1.
Another example:
GET /wp/v2/users/me
=> returns a 401 error, "You are not currently logged in."
I have read on wordpress.stackexchange.com: here, there about nonces (X-WP-Nonce
header) but this applies for plugins or themes.
I also know an auth nonce is sent with the Authorization
header.
So, the question is how to have the user logged in / a valid nonce?
There is a 404 for the image: img/wp.png
When i hit the auth button the /oauth1/request
returns a 400 (Bad Request)
error
Hello,
Thank you for the API console.
In Step 1: Creating a Consumer, the menu path should read Users > Applications, not Applications > Users.
It should be noted that once installed, the API Console interface, looks nothing like the actual API Console it references. It might be obvious to others, but wasn't to me.
I followed the instructions in the readme (wp oauth1 add
) then get this error when I try to authenticate:
There is no callback
property on the json_consumer
post object, so this check in check_callback
fails:
$registered = $consumer->callback;
if ( empty( $registered ) ) {
return false;
}
I saw a comment referencing doing this from the admin area instead (WP-API/OAuth1#53 (comment)) but I couldn't find where.
References box doesn't auto-populate even though receiving correct response.
In "Step 1: Creating a Consumer", the README describes running 'wp oauth1 add' on the command line. This requires wp-cli, right? Had to figure that out myself. Now I've installed wp-cli, so I can run that command, but it gives me no output. Am I missing something else? More info please! README should mention/link to pre-reqs.
Hi I have this set up at the below url
https://man-sudarshann-1.c9.io/api/
I am getting this error OAuth signature does not match. I have tried all the fixed for this over the internet. but none helped
$signature = 5rPsul6zplhfNvb4o+Mz11O/OyI=
$consumer_signature = 3ko8DUsUUEB4Hqaks68vGYnTjQM=
if ( ! hash_equals( $signature, $consumer_signature ) ) {
return new WP_Error( 'json_oauth1_signature_mismatch', __( 'OAuth signature does not match' ), array( 'status' => 401 ) );
}
I guess the API console is generating wrong signature. Please help me with this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.