auth0 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71cda3daf6751d34d6e427ef7f136028c6f78f91
4
- data.tar.gz: 798306ef062c68bd2082e026a8e9d1513773ad90
3
+ metadata.gz: 5a4327521f8791b8e00272ec8b83dbff1483ca1d
4
+ data.tar.gz: bd73c85436b39923dd2c6ae499ab68ba159a6415
5
5
  SHA512:
6
- metadata.gz: acd389c555d36bb006a76d4a3b28dbdd7afd6cd52126ae3591e5bf51d8112045c20e317a889b3f1e55ef0f45920e0c893789811f95203021d48ecaa1150c3606
7
- data.tar.gz: 2fc070c9f659d1fd41194c4dbb3e18ab71e8347834e1e4326dfa5b51cb202b64e9c91407d213daf37acf8d0131239b1d9c671f69e6d6e387e0b7e6ad1556cadb
6
+ metadata.gz: 9fc47b40705ca2f94b86c42a8fc7a31632d6c0c2f920efe0d8335761171ca7a94175a0cc00f6f6226ab6f859a774151bdfc988b75c3176963fb2550122edafd4
7
+ data.tar.gz: b59da5337022253dd21afadc2ba485706629686e4d8000bdba0e20a6425d76a0160c78028c10002a3086b9a1c0877303b7a48053a8b2295332d93f22471a6e5f
data/README.md CHANGED
@@ -22,6 +22,19 @@ auth0 = Auth0Client.new(
22
22
  puts auth0.get_connections;
23
23
  ```
24
24
 
25
+ Using [APIv2](https://auth0.com/docs/apiv2)
26
+
27
+ ```ruby
28
+ require "auth0"
29
+
30
+ auth0 = Auth0Client.new(
31
+ :api_version => 2,
32
+ :token => "YOUR JWT HERE"
33
+ );
34
+
35
+ puts auth0.get_users;
36
+ ```
37
+
25
38
  ## License
26
39
 
27
40
  MIT 2014 - Auth0 INC.
@@ -6,14 +6,14 @@ module Auth0
6
6
  # accepts hash as parameter
7
7
  # you can get all required fields from here: https://auth0.com/docs/auth-api
8
8
  #
9
- # To run using api v2, pass protocols: "v2" when creating a client
9
+ # To run using api v2, pass api_version: 2 when creating a client
10
10
  def initialize(config)
11
11
  options = Hash[config.map{|(k,v)| [k.to_sym,v]}]
12
12
  self.class.base_uri "https://#{options[:namespace]}"
13
13
  self.class.headers "Content-Type" => 'application/json'
14
- if options[:protocols].to_s.include?("v2")
14
+ if options[:protocols].to_s.include?("v2") or options[:api_version] === 2
15
15
  self.extend Auth0::Api::V2
16
- @token = options[:access_token]
16
+ @token = options[:access_token] or options[:token]
17
17
  else
18
18
  self.extend Auth0::Api::V1
19
19
  self.extend Auth0::Api::AuthenticationEndpoints
@@ -1,4 +1,4 @@
1
1
  module Auth0
2
2
  # current version of gem
3
- VERSION = "3.0.0"
3
+ VERSION = "3.1.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Auth0