wc-api-java icon indicating copy to clipboard operation
wc-api-java copied to clipboard

http request failed using Oauth 1.0

Open guilherme-oliveria opened this issue 6 years ago • 5 comments

I'm having difficulty getting into my products, because the url error http 401, oh consumer_key is correct and the secret is also the only way I can get the data and passing the "cafearabesco.com/wp-json/wc/v2/products?consume_key=ajsajs77kajsak....&consume_secret=njnjnjnjn2n3j23nj2.." but this way it is not safe and on the server in production of the ssl error.

http://uploaddeimagens.com.br/imagens/postman_12-png

http://uploaddeimagens.com.br/imagens/postman-jpg

guilherme-oliveria avatar Apr 02 '18 14:04 guilherme-oliveria

copy and paste the link in the browser

guilherme-oliveria avatar Apr 02 '18 14:04 guilherme-oliveria

Hi @guilherme-oliveria if you have SSL on your server you may use Basic Authentication: http://woocommerce.github.io/woocommerce-rest-api-docs/#authentication-over-https

omandryk avatar Apr 02 '18 14:04 omandryk

add params "query_string_auth" = true

guilherme-oliveria avatar Apr 02 '18 16:04 guilherme-oliveria

in classe enum OauthHeader

guilherme-oliveria avatar Apr 02 '18 16:04 guilherme-oliveria

I have not been successful since yesterday. my localhost application works but on the server in production because my site in wp and https, and the class DefaulthttpClient uses, HttpResponse httpResponse = httpClient.execute(httpRequest);
and my server from ssl error. " Caused by: javax.net.ssl.SSLPeerUnverifiedException: Host name 'antioquia.com' does not match the certificate subject provided by the peer"

guilherme-oliveria avatar Apr 03 '18 18:04 guilherme-oliveria