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 +4 -4
- data/README.md +13 -0
- data/lib/auth0/mixins/initializer.rb +3 -3
- data/lib/auth0/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4327521f8791b8e00272ec8b83dbff1483ca1d
|
4
|
+
data.tar.gz: bd73c85436b39923dd2c6ae499ab68ba159a6415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/auth0/version.rb
CHANGED