WPIntell

Source evidence

Unknown user

API Bearer Auth · support · 2024-11-06T17:53:00+00:00

complaintsentiment
mediumseverity
0.75relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 25 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
adz1111 unresolved
Hi Thanks for the plugin; it all works great, and when I test it in postman it all works fine. However, if I try to “login” within a wordpress function (using the exact credentials in the body I used in postman), I get an “unknown username” error. I am guessing I am not perhaps calling the login endpoint correctly? Here’s how I am calling it (I have omitted error checking lines for clarity): $url = 'https://testsite.net/wp-json/api-bearer-auth/v1/login'; $apw = 'a-test-app-password-for-admin-user-called-testuser' ; $args = array( 'body' => array( "username" => "testuser", "password" => $apw, "client_name" => "api-bearer", ), ); $response = wp_remote_post( $url, $args ); $body = wp_remote_retrieve_body( $response ); $data = json_decode( $body ); // Error checking gives the unknown username error? $bt = isset( $data->access_token ) ? $data->access_token : null; $rt = isset( $data->refresh_token ) ? $data->refresh_token : null; Like I said, in postman, doing a POST to the URL above with a body of: { “username”: “testuser”, “password”: “a-test-app-password-for-admin-user-called-testuser”, “client_name”: “api-bearer” } …works fine. Any ideas where I am messing up, please? Thanks, Adam

Comments

0 shown

No comments were stored for this source.