auth0 1.0.0 → 2.0.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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWFiMzBiNjAwODRmYzZiMTNjMTk4ZmU4ZTkzNTRkZTY3MmNlZmIxYg==
5
- data.tar.gz: !binary |-
6
- MDk0MjVmYTljZWU3YmE1M2EzZDcyMDJjYjg1ODZiY2ZhMGEyNWUyYw==
2
+ SHA1:
3
+ metadata.gz: 15aeb96ddd94fcecb0e277e5a0707de7698e0eb1
4
+ data.tar.gz: 4402d3682bb521469e4111ce3628333621a21cdc
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MjkzYmUxNGQxZTNiYTI3NzhiZjg5NzIzMjc5MjIyNTExNmRmNTgxZmNhZTQw
10
- NGNmZDcxZDI0OWVlNzUxN2Q0YmQxNWExNGMzYzk4ZGQzMmIwOGU2YzI2MDBk
11
- ZDUxMzE3YzhmZDViYjNjZTYwMDA0NjQ2NTBhZWIyNDk3YmY2MjA=
12
- data.tar.gz: !binary |-
13
- YmRlZGY0MTEzZDJlYTAyNmU1NGFlMzM0MmQ2ZTc1OTQwNDBlYWZlMzFlNWFh
14
- ZTlmOTY2ZmI1MjVjODM5NDE0ZjQ3OGU0MzM3OWI5ZDNiM2YxYjg0ODNmNzI4
15
- NjFmNjI5MGZjYjY5NzljMzhiYTAyZTRhMGVlOWIzMmYyYWJkYjE=
6
+ metadata.gz: 29aa0af5b24107412984ab89c9d0ed03eb7e3a13d7146d315622d2c69d715bb28b36832947ea376db1144d91f4bbdab501bfdfabd03b4837795600dd47df133f
7
+ data.tar.gz: 4b2115849b2c7b701abacdc8d751452d40f55d4ac5a5d77e221944544afca454c1eaef2038dc135bb7ba93e61593039e6ed8e0592f8988f7adfe8910c3cdf443
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # OmniAuth Auth0
2
2
 
3
- This is the official OmniAuth strategy for authenticating to Auth0. To
4
- use it, you'll need to sign up for an OAuth2 Application ID and Secret
5
- on the [Auth0 Page](https://app.auth0.com).
3
+ This is the official OmniAuth strategy for authenticating to [Auth0](https://auth0.com).
6
4
 
7
5
  ## Basic Usage
8
6
 
@@ -32,4 +30,4 @@ For more information about [auth0](http://auth0.com) contact our [documentation
32
30
 
33
31
  ## License
34
32
 
35
- This client library is MIT licensed.
33
+ This client library is MIT licensed.
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
22
+ s.add_runtime_dependency 'httparty', '~> 0.13'
22
23
 
23
24
  s.add_development_dependency 'rspec', '~> 2.7'
24
25
  s.add_development_dependency 'rack-test'
@@ -1,2 +1,3 @@
1
1
  require "auth0/version"
2
+ require "auth0/client"
2
3
  require "omniauth/strategies/auth0"
@@ -0,0 +1,32 @@
1
+ require 'httparty'
2
+
3
+ class Auth0Client
4
+ include HTTParty
5
+ base_uri 'login.auth0.com'
6
+
7
+ def initialize(options)
8
+ self.class.base_uri "https://#{options[:namespace]}"
9
+
10
+ token_reponse = self.class.post("/oauth/token", {
11
+ body: {
12
+ 'client_id' => options[:client_id],
13
+ 'client_secret' => options[:client_secret],
14
+ 'grant_type' => 'client_credentials'
15
+ }
16
+ })
17
+
18
+ unless token_reponse.code == 200
19
+ raise "Error geting the token: #{token_reponse.body}"
20
+ end
21
+
22
+ @token = token_reponse["access_token"]
23
+ @headers = {
24
+ "Authorization" => "Bearer #{@token}"
25
+ }
26
+ end
27
+
28
+ def get_connections
29
+ response = self.class.get("/api/connections", { headers: @headers })
30
+ response.body
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Auth0
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -16,6 +16,10 @@ module OmniAuth
16
16
 
17
17
  def initialize(app, *args, &block)
18
18
  super
19
+
20
+ warn "[DEPRECATION] The omniauth strategy in this gem is deprecated."
21
+ warn "[DEPRECATION] Please use the gem omniauth-auth0."
22
+
19
23
  @options.provider_ignores_state = args[3] unless args[3].nil?
20
24
 
21
25
  @options.client_options.site = "https://#{options[:namespace]}"
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: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Auth0
@@ -10,76 +10,90 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-02-19 00:00:00.000000000 Z
13
+ date: 2014-06-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: omniauth-oauth2
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '1.1'
29
+ - !ruby/object:Gem::Dependency
30
+ name: httparty
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '0.13'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.13'
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: rspec
31
45
  requirement: !ruby/object:Gem::Requirement
32
46
  requirements:
33
- - - ~>
47
+ - - "~>"
34
48
  - !ruby/object:Gem::Version
35
49
  version: '2.7'
36
50
  type: :development
37
51
  prerelease: false
38
52
  version_requirements: !ruby/object:Gem::Requirement
39
53
  requirements:
40
- - - ~>
54
+ - - "~>"
41
55
  - !ruby/object:Gem::Version
42
56
  version: '2.7'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: rack-test
45
59
  requirement: !ruby/object:Gem::Requirement
46
60
  requirements:
47
- - - ! '>='
61
+ - - ">="
48
62
  - !ruby/object:Gem::Version
49
63
  version: '0'
50
64
  type: :development
51
65
  prerelease: false
52
66
  version_requirements: !ruby/object:Gem::Requirement
53
67
  requirements:
54
- - - ! '>='
68
+ - - ">="
55
69
  - !ruby/object:Gem::Version
56
70
  version: '0'
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: simplecov
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - ! '>='
75
+ - - ">="
62
76
  - !ruby/object:Gem::Version
63
77
  version: '0'
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - ! '>='
82
+ - - ">="
69
83
  - !ruby/object:Gem::Version
70
84
  version: '0'
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: webmock
73
87
  requirement: !ruby/object:Gem::Requirement
74
88
  requirements:
75
- - - ! '>='
89
+ - - ">="
76
90
  - !ruby/object:Gem::Version
77
91
  version: '0'
78
92
  type: :development
79
93
  prerelease: false
80
94
  version_requirements: !ruby/object:Gem::Requirement
81
95
  requirements:
82
- - - ! '>='
96
+ - - ">="
83
97
  - !ruby/object:Gem::Version
84
98
  version: '0'
85
99
  description: Ruby client library for the Auth0 platform.
@@ -89,12 +103,13 @@ executables: []
89
103
  extensions: []
90
104
  extra_rdoc_files: []
91
105
  files:
92
- - .gitignore
106
+ - ".gitignore"
93
107
  - Gemfile
94
108
  - README.md
95
109
  - Rakefile
96
110
  - auth0.gemspec
97
111
  - lib/auth0.rb
112
+ - lib/auth0/client.rb
98
113
  - lib/auth0/version.rb
99
114
  - lib/omniauth/strategies/auth0.rb
100
115
  - spec/omniauth/strategies/auth0_spec.rb
@@ -109,12 +124,12 @@ require_paths:
109
124
  - lib
110
125
  required_ruby_version: !ruby/object:Gem::Requirement
111
126
  requirements:
112
- - - ! '>='
127
+ - - ">="
113
128
  - !ruby/object:Gem::Version
114
129
  version: '0'
115
130
  required_rubygems_version: !ruby/object:Gem::Requirement
116
131
  requirements:
117
- - - ! '>='
132
+ - - ">="
118
133
  - !ruby/object:Gem::Version
119
134
  version: '0'
120
135
  requirements: []