Skip to content

Commit fb088ec

Browse files
Update ruby basic auth examples
1 parent 3ccbb8c commit fb088ec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

source/includes/wp-api-v1/_authentication.md

+15
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,21 @@ wcapi = API(
272272
)
273273
```
274274

275+
```ruby
276+
require "woocommerce_api"
277+
278+
woocommerce = WooCommerce::API.new(
279+
"https://example.com",
280+
"consumer_key",
281+
"consumer_secret",
282+
{
283+
wp_json: true,
284+
version: "wc/v1",
285+
query_string_auth: true // Force Basic Authentication as query string true and using under HTTPS
286+
}
287+
)
288+
```
289+
275290
## Authentication over HTTP ##
276291

277292
You must use [OAuth 1.0a "one-legged" authentication](http://tools.ietf.org/html/rfc5849) to ensure REST API credentials cannot be intercepted by an attacker. Typically you will use any standard OAuth 1.0a library in the language of your choice to handle the authentication, or generate the necessary parameters by following the following instructions.

0 commit comments

Comments
 (0)