auth0-ruby 0.9 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -2
- data/auth0.gemspec +2 -1
- data/doc/Auth0.html +2 -2
- data/doc/Auth0/Api.html +1 -1
- data/doc/Auth0/Api/AuthenticationEndpoints.html +1 -1
- data/doc/Auth0/Api/V1.html +1 -1
- data/doc/Auth0/Api/V1/Clients.html +1 -1
- data/doc/Auth0/Api/V1/Connections.html +1 -1
- data/doc/Auth0/Api/V1/Logs.html +1 -1
- data/doc/Auth0/Api/V1/Rules.html +1 -1
- data/doc/Auth0/Api/V1/Users.html +1 -1
- data/doc/Auth0/BadRequest.html +1 -1
- data/doc/Auth0/Client.html +1 -1
- data/doc/Auth0/Exception.html +1 -1
- data/doc/Auth0/Mixins.html +3 -3
- data/doc/Auth0/Mixins/HTTPartyProxy.html +1 -1
- data/doc/Auth0/Mixins/Initializer.html +15 -7
- data/doc/Auth0/Mixins/JwtOperations.html +202 -0
- data/doc/Auth0/NotFound.html +1 -1
- data/doc/Auth0/ServerError.html +1 -1
- data/doc/Auth0/Unauthorized.html +1 -1
- data/doc/Auth0/Unsupported.html +1 -1
- data/doc/Auth0/UserIdIsBlank.html +1 -1
- data/doc/Auth0Client.html +1 -1
- data/doc/_index.html +19 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +38 -32
- data/doc/top-level-namespace.html +1 -1
- data/lib/auth0/mixins/initializer.rb +5 -1
- data/lib/auth0/mixins/jwt_operations.rb +14 -0
- data/lib/auth0/version.rb +1 -1
- data/spec/lib/auth0/client_spec.rb +7 -0
- data/spec/lib/auth0/mixins/jwt_operations_spec.rb +31 -0
- data/spec/support/stub_class_with_client_secret.rb +7 -0
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9160ec480e40581c73ec2d8b97baed34485bc399
|
4
|
+
data.tar.gz: 1e63e8aa0dde6ccf9028755da24c7d952d39c824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 113c8830ef996c3a13a05a9d803dd16db6560c33d63a7e7d44eb0bcc7c31cee65862d1acda7fabd3d17c0f66540ce9bf9242e31e83fd10d8d63446bc4214a68c
|
7
|
+
data.tar.gz: fb830ed74923711ba86bb1bbee3b8f8a98e7402af52ecc73f26a839d3cd41633da8bd66bbc25fc1b6f9bf52b3506e691c0ff33bdd1350858c9edc05d0a68841f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
auth0 (
|
4
|
+
auth0-ruby (0.9.1)
|
5
5
|
httparty (~> 0.13)
|
6
6
|
|
7
7
|
GEM
|
@@ -25,6 +25,7 @@ GEM
|
|
25
25
|
multi_xml (>= 0.5.2)
|
26
26
|
i18n (0.7.0)
|
27
27
|
json (1.8.1)
|
28
|
+
jwt (1.0.0)
|
28
29
|
multi_json (1.10.1)
|
29
30
|
multi_xml (0.5.5)
|
30
31
|
rack (1.5.2)
|
@@ -58,9 +59,10 @@ PLATFORMS
|
|
58
59
|
ruby
|
59
60
|
|
60
61
|
DEPENDENCIES
|
61
|
-
auth0!
|
62
|
+
auth0-ruby!
|
62
63
|
byebug
|
63
64
|
faker
|
65
|
+
jwt
|
64
66
|
rack-test
|
65
67
|
rspec (~> 3.1.0, >= 3.1.0)
|
66
68
|
simplecov
|
data/auth0.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
19
|
s.add_runtime_dependency 'httparty', '~> 0.13'
|
20
|
-
|
20
|
+
s.required_ruby_version = '>= 1.9.3'
|
21
21
|
s.add_development_dependency 'rspec', '~> 3.1.0', '>= 3.1.0'
|
22
22
|
s.add_development_dependency 'rack-test'
|
23
23
|
s.add_development_dependency 'simplecov'
|
@@ -25,5 +25,6 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency 'byebug'
|
26
26
|
s.add_development_dependency 'faker'
|
27
27
|
s.add_development_dependency 'yard'
|
28
|
+
s.add_development_dependency 'jwt'
|
28
29
|
s.license = 'MIT'
|
29
30
|
end
|
data/doc/Auth0.html
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
<dt class="r1 last">Defined in:</dt>
|
82
82
|
<dd class="r1 last">lib/auth0.rb<span class="defines">,<br />
|
83
|
-
lib/auth0/api/v1.rb,<br /> lib/auth0/version.rb,<br /> lib/auth0/exception.rb,<br /> lib/auth0/api/v1/logs.rb,<br /> lib/auth0/api/v1/users.rb,<br /> lib/auth0/api/v1/rules.rb,<br /> lib/auth0/api/v1/clients.rb,<br /> lib/auth0/api/v1/connections.rb,<br /> lib/auth0/mixins/
|
83
|
+
lib/auth0/api/v1.rb,<br /> lib/auth0/version.rb,<br /> lib/auth0/exception.rb,<br /> lib/auth0/api/v1/logs.rb,<br /> lib/auth0/api/v1/users.rb,<br /> lib/auth0/api/v1/rules.rb,<br /> lib/auth0/api/v1/clients.rb,<br /> lib/auth0/mixins/initializer.rb,<br /> lib/auth0/api/v1/connections.rb,<br /> lib/auth0/mixins/httparty_proxy.rb,<br /> lib/auth0/mixins/jwt_operations.rb,<br /> lib/auth0/api/authentication_endpoints.rb</span>
|
84
84
|
</dd>
|
85
85
|
|
86
86
|
</dl>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div id="footer">
|
147
|
-
Generated on
|
147
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
148
148
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
149
149
|
0.8.7.6 (ruby-2.0.0).
|
150
150
|
</div>
|
data/doc/Auth0/Api.html
CHANGED
@@ -119,7 +119,7 @@
|
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div id="footer">
|
122
|
-
Generated on
|
122
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
124
|
0.8.7.6 (ruby-2.0.0).
|
125
125
|
</div>
|
@@ -587,7 +587,7 @@ authentication endpoints</p>
|
|
587
587
|
</div>
|
588
588
|
|
589
589
|
<div id="footer">
|
590
|
-
Generated on
|
590
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
591
591
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
592
592
|
0.8.7.6 (ruby-2.0.0).
|
593
593
|
</div>
|
data/doc/Auth0/Api/V1.html
CHANGED
@@ -183,7 +183,7 @@ V1</p>
|
|
183
183
|
</div>
|
184
184
|
|
185
185
|
<div id="footer">
|
186
|
-
Generated on
|
186
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
187
187
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
188
188
|
0.8.7.6 (ruby-2.0.0).
|
189
189
|
</div>
|
@@ -431,7 +431,7 @@
|
|
431
431
|
</div>
|
432
432
|
|
433
433
|
<div id="footer">
|
434
|
-
Generated on
|
434
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
435
435
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
436
436
|
0.8.7.6 (ruby-2.0.0).
|
437
437
|
</div>
|
@@ -497,7 +497,7 @@
|
|
497
497
|
</div>
|
498
498
|
|
499
499
|
<div id="footer">
|
500
|
-
Generated on
|
500
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
501
501
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
502
502
|
0.8.7.6 (ruby-2.0.0).
|
503
503
|
</div>
|
data/doc/Auth0/Api/V1/Logs.html
CHANGED
@@ -357,7 +357,7 @@
|
|
357
357
|
</div>
|
358
358
|
|
359
359
|
<div id="footer">
|
360
|
-
Generated on
|
360
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
361
361
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
362
362
|
0.8.7.6 (ruby-2.0.0).
|
363
363
|
</div>
|
data/doc/Auth0/Api/V1/Rules.html
CHANGED
@@ -430,7 +430,7 @@ href="https://auth0.com/docs/api#!#put--api-rules--rule-name">auth0.com/docs/api
|
|
430
430
|
</div>
|
431
431
|
|
432
432
|
<div id="footer">
|
433
|
-
Generated on
|
433
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
434
434
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
435
435
|
0.8.7.6 (ruby-2.0.0).
|
436
436
|
</div>
|
data/doc/Auth0/Api/V1/Users.html
CHANGED
@@ -1608,7 +1608,7 @@ instead</p>
|
|
1608
1608
|
</div>
|
1609
1609
|
|
1610
1610
|
<div id="footer">
|
1611
|
-
Generated on
|
1611
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
1612
1612
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1613
1613
|
0.8.7.6 (ruby-2.0.0).
|
1614
1614
|
</div>
|
data/doc/Auth0/BadRequest.html
CHANGED
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on
|
136
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.8.7.6 (ruby-2.0.0).
|
139
139
|
</div>
|
data/doc/Auth0/Client.html
CHANGED
@@ -227,7 +227,7 @@ return strings.</p>
|
|
227
227
|
</div>
|
228
228
|
|
229
229
|
<div id="footer">
|
230
|
-
Generated on
|
230
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
231
231
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
232
232
|
0.8.7.6 (ruby-2.0.0).
|
233
233
|
</div>
|
data/doc/Auth0/Exception.html
CHANGED
@@ -131,7 +131,7 @@ included</p>
|
|
131
131
|
</div>
|
132
132
|
|
133
133
|
<div id="footer">
|
134
|
-
Generated on
|
134
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
135
135
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
136
136
|
0.8.7.6 (ruby-2.0.0).
|
137
137
|
</div>
|
data/doc/Auth0/Mixins.html
CHANGED
@@ -88,7 +88,7 @@
|
|
88
88
|
|
89
89
|
<dt class="r1 last">Defined in:</dt>
|
90
90
|
<dd class="r1 last">lib/auth0/mixins.rb<span class="defines">,<br />
|
91
|
-
lib/auth0/mixins/initializer.rb,<br /> lib/auth0/mixins/httparty_proxy.rb</span>
|
91
|
+
lib/auth0/mixins/initializer.rb,<br /> lib/auth0/mixins/httparty_proxy.rb,<br /> lib/auth0/mixins/jwt_operations.rb</span>
|
92
92
|
</dd>
|
93
93
|
|
94
94
|
</dl>
|
@@ -109,7 +109,7 @@
|
|
109
109
|
<p class="children">
|
110
110
|
|
111
111
|
|
112
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Mixins/HTTPartyProxy.html" title="Auth0::Mixins::HTTPartyProxy (module)">HTTPartyProxy</a></span>, <span class='object_link'><a href="Mixins/Initializer.html" title="Auth0::Mixins::Initializer (module)">Initializer</a></span>
|
112
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Mixins/HTTPartyProxy.html" title="Auth0::Mixins::HTTPartyProxy (module)">HTTPartyProxy</a></span>, <span class='object_link'><a href="Mixins/Initializer.html" title="Auth0::Mixins::Initializer (module)">Initializer</a></span>, <span class='object_link'><a href="Mixins/JwtOperations.html" title="Auth0::Mixins::JwtOperations (module)">JwtOperations</a></span>
|
113
113
|
|
114
114
|
|
115
115
|
|
@@ -216,7 +216,7 @@
|
|
216
216
|
</div>
|
217
217
|
|
218
218
|
<div id="footer">
|
219
|
-
Generated on
|
219
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
220
220
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
221
221
|
0.8.7.6 (ruby-2.0.0).
|
222
222
|
</div>
|
@@ -112,7 +112,7 @@ gem for now, if you want to feel free to use your own http client</p>
|
|
112
112
|
</div>
|
113
113
|
|
114
114
|
<div id="footer">
|
115
|
-
Generated on
|
115
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
116
116
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
117
117
|
0.8.7.6 (ruby-2.0.0).
|
118
118
|
</div>
|
@@ -208,12 +208,12 @@ href="https://auth0.com/docs/auth-api">auth0.com/docs/auth-api</a>.</p>
|
|
208
208
|
<pre class="lines">
|
209
209
|
|
210
210
|
|
211
|
-
|
212
|
-
|
213
|
-
|
211
|
+
23
|
212
|
+
24
|
213
|
+
25</pre>
|
214
214
|
</td>
|
215
215
|
<td>
|
216
|
-
<pre class="code"><span class="info file"># File 'lib/auth0/mixins/initializer.rb', line
|
216
|
+
<pre class="code"><span class="info file"># File 'lib/auth0/mixins/initializer.rb', line 23</span>
|
217
217
|
|
218
218
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
|
219
219
|
<span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='symbol'>:prepend</span><span class='comma'>,</span> <span class='const'>Initializer</span>
|
@@ -265,19 +265,27 @@ href="https://auth0.com/docs/auth-api">auth0.com/docs/auth-api</a></p>
|
|
265
265
|
13
|
266
266
|
14
|
267
267
|
15
|
268
|
-
16
|
268
|
+
16
|
269
|
+
17
|
270
|
+
18
|
271
|
+
19
|
272
|
+
20</pre>
|
269
273
|
</td>
|
270
274
|
<td>
|
271
275
|
<pre class="code"><span class="info file"># File 'lib/auth0/mixins/initializer.rb', line 8</span>
|
272
276
|
|
273
277
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
|
274
278
|
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbracket'>]</span>
|
275
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_base_uri'>base_uri</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://</span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:namespace</span><span class='rbracket'>]</span>
|
279
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_base_uri'>base_uri</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://</span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:namespace</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
276
280
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/json</span><span class='tstring_end'>'</span></span>
|
277
281
|
<span class='ivar'>@client_id</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:client_id</span><span class='rbracket'>]</span>
|
278
282
|
<span class='ivar'>@client_secret</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:client_secret</span><span class='rbracket'>]</span>
|
279
283
|
<span class='ivar'>@token</span> <span class='op'>=</span> <span class='id identifier rubyid_obtain_access_token'>obtain_access_token</span>
|
280
284
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Authorization</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bearer </span><span class='embexpr_beg'>#{</span><span class='ivar'>@token</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
285
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:jwt</span><span class='rbracket'>]</span>
|
286
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auth0/mixins/jwt_operations</span><span class='tstring_end'>'</span></span>
|
287
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:include</span><span class='comma'>,</span> <span class='const'>Auth0</span><span class='op'>::</span><span class='const'>Mixins</span><span class='op'>::</span><span class='const'>JwtOperations</span><span class='rparen'>)</span>
|
288
|
+
<span class='kw'>end</span>
|
281
289
|
<span class='kw'>end</span></pre>
|
282
290
|
</td>
|
283
291
|
</tr>
|
@@ -289,7 +297,7 @@ href="https://auth0.com/docs/auth-api">auth0.com/docs/auth-api</a></p>
|
|
289
297
|
</div>
|
290
298
|
|
291
299
|
<div id="footer">
|
292
|
-
Generated on
|
300
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
293
301
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
294
302
|
0.8.7.6 (ruby-2.0.0).
|
295
303
|
</div>
|
@@ -0,0 +1,202 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Auth0::Mixins::JwtOperations
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!Auth0/Mixins/JwtOperations.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (J)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Auth0.html" title="Auth0 (module)">Auth0</a></span></span> » <span class='title'><span class='object_link'><a href="../Mixins.html" title="Auth0::Mixins (module)">Mixins</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">JwtOperations</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Auth0::Mixins::JwtOperations
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/auth0/mixins/jwt_operations.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
88
|
+
<div class="discussion">
|
89
|
+
|
90
|
+
<p>Working with JWT</p>
|
91
|
+
|
92
|
+
<p><a href="https://auth0.com/docs/jwt">auth0.com/docs/jwt</a></p>
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div class="tags">
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<h2>
|
109
|
+
Instance Method Summary
|
110
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
111
|
+
</h2>
|
112
|
+
|
113
|
+
<ul class="summary">
|
114
|
+
|
115
|
+
<li class="public ">
|
116
|
+
<span class="summary_signature">
|
117
|
+
|
118
|
+
<a href="#decode_jwt-instance_method" title="#decode_jwt (instance method)">- (Object) <strong>decode_jwt</strong>(token, client_secret = @client_secret) </a>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
</span>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<span class="summary_desc"><div class='inline'>
|
133
|
+
<p><a
|
134
|
+
href="https://auth0.com/docs/server-apis/ruby">auth0.com/docs/server-apis/ruby</a>.</p>
|
135
|
+
</div></span>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
|
139
|
+
|
140
|
+
</ul>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<div id="instance_method_details" class="method_details_list">
|
146
|
+
<h2>Instance Method Details</h2>
|
147
|
+
|
148
|
+
|
149
|
+
<div class="method_details first">
|
150
|
+
<h3 class="signature first" id="decode_jwt-instance_method">
|
151
|
+
|
152
|
+
- (<tt>Object</tt>) <strong>decode_jwt</strong>(token, client_secret = @client_secret)
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</h3><div class="docstring">
|
159
|
+
<div class="discussion">
|
160
|
+
|
161
|
+
<p><a
|
162
|
+
href="https://auth0.com/docs/server-apis/ruby">auth0.com/docs/server-apis/ruby</a></p>
|
163
|
+
|
164
|
+
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
<div class="tags">
|
168
|
+
|
169
|
+
|
170
|
+
</div><table class="source_code">
|
171
|
+
<tr>
|
172
|
+
<td>
|
173
|
+
<pre class="lines">
|
174
|
+
|
175
|
+
|
176
|
+
9
|
177
|
+
10
|
178
|
+
11</pre>
|
179
|
+
</td>
|
180
|
+
<td>
|
181
|
+
<pre class="code"><span class="info file"># File 'lib/auth0/mixins/jwt_operations.rb', line 9</span>
|
182
|
+
|
183
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_decode_jwt'>decode_jwt</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='op'>=</span><span class='ivar'>@client_secret</span><span class='rparen'>)</span>
|
184
|
+
<span class='const'>JWT</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span><span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_decode64'>decode64</span><span class='lparen'>(</span><span class='id identifier rubyid_client_secret'>client_secret</span><span class='period'>.</span><span class='id identifier rubyid_tr'>tr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-_</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
185
|
+
<span class='kw'>end</span></pre>
|
186
|
+
</td>
|
187
|
+
</tr>
|
188
|
+
</table>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div id="footer">
|
196
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
197
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
+
0.8.7.6 (ruby-2.0.0).
|
199
|
+
</div>
|
200
|
+
|
201
|
+
</body>
|
202
|
+
</html>
|
data/doc/Auth0/NotFound.html
CHANGED
@@ -134,7 +134,7 @@ wrong path</p>
|
|
134
134
|
</div>
|
135
135
|
|
136
136
|
<div id="footer">
|
137
|
-
Generated on
|
137
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
138
138
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
139
139
|
0.8.7.6 (ruby-2.0.0).
|
140
140
|
</div>
|
data/doc/Auth0/ServerError.html
CHANGED
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on
|
136
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.8.7.6 (ruby-2.0.0).
|
139
139
|
</div>
|
data/doc/Auth0/Unauthorized.html
CHANGED
@@ -134,7 +134,7 @@ is not set correctly</p>
|
|
134
134
|
</div>
|
135
135
|
|
136
136
|
<div id="footer">
|
137
|
-
Generated on
|
137
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
138
138
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
139
139
|
0.8.7.6 (ruby-2.0.0).
|
140
140
|
</div>
|
data/doc/Auth0/Unsupported.html
CHANGED
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on
|
136
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
137
137
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
138
138
|
0.8.7.6 (ruby-2.0.0).
|
139
139
|
</div>
|
@@ -134,7 +134,7 @@ other unexpected bahaviour</p>
|
|
134
134
|
</div>
|
135
135
|
|
136
136
|
<div id="footer">
|
137
|
-
Generated on
|
137
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
138
138
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
139
139
|
0.8.7.6 (ruby-2.0.0).
|
140
140
|
</div>
|
data/doc/Auth0Client.html
CHANGED
@@ -226,7 +226,7 @@
|
|
226
226
|
</div>
|
227
227
|
|
228
228
|
<div id="footer">
|
229
|
-
Generated on
|
229
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
230
230
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
231
231
|
0.8.7.6 (ruby-2.0.0).
|
232
232
|
</div>
|
data/doc/_index.html
CHANGED
@@ -201,6 +201,24 @@
|
|
201
201
|
</ul>
|
202
202
|
|
203
203
|
|
204
|
+
<ul id="alpha_J" class="alpha">
|
205
|
+
<li class="letter">J</li>
|
206
|
+
<ul>
|
207
|
+
|
208
|
+
<li>
|
209
|
+
<span class='object_link'><a href="Auth0/Mixins/JwtOperations.html" title="Auth0::Mixins::JwtOperations (module)">JwtOperations</a></span>
|
210
|
+
|
211
|
+
<small>(Auth0::Mixins)</small>
|
212
|
+
|
213
|
+
</li>
|
214
|
+
|
215
|
+
</ul>
|
216
|
+
</ul>
|
217
|
+
|
218
|
+
|
219
|
+
</td><td valign='top' width="33%">
|
220
|
+
|
221
|
+
|
204
222
|
<ul id="alpha_L" class="alpha">
|
205
223
|
<li class="letter">L</li>
|
206
224
|
<ul>
|
@@ -216,9 +234,6 @@
|
|
216
234
|
</ul>
|
217
235
|
|
218
236
|
|
219
|
-
</td><td valign='top' width="33%">
|
220
|
-
|
221
|
-
|
222
237
|
<ul id="alpha_M" class="alpha">
|
223
238
|
<li class="letter">M</li>
|
224
239
|
<ul>
|
@@ -338,7 +353,7 @@
|
|
338
353
|
</div>
|
339
354
|
|
340
355
|
<div id="footer">
|
341
|
-
Generated on
|
356
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
342
357
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
343
358
|
0.8.7.6 (ruby-2.0.0).
|
344
359
|
</div>
|
data/doc/class_list.html
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
<ul id="full_list" class="class">
|
52
52
|
<li><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></li>
|
53
|
-
<li><a class='toggle'></a> <span class='object_link'><a href="Auth0.html" title="Auth0 (module)">Auth0</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Api.html" title="Auth0::Api (module)">Api</a></span><small class='search_info'>Auth0</small></li><ul><li><span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html" title="Auth0::Api::AuthenticationEndpoints (module)">AuthenticationEndpoints</a></span><small class='search_info'>Auth0::Api</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Api/V1.html" title="Auth0::Api::V1 (module)">V1</a></span><small class='search_info'>Auth0::Api</small></li><ul><li><span class='object_link'><a href="Auth0/Api/V1/Clients.html" title="Auth0::Api::V1::Clients (module)">Clients</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Connections.html" title="Auth0::Api::V1::Connections (module)">Connections</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Logs.html" title="Auth0::Api::V1::Logs (module)">Logs</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Rules.html" title="Auth0::Api::V1::Rules (module)">Rules</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Users.html" title="Auth0::Api::V1::Users (module)">Users</a></span><small class='search_info'>Auth0::Api::V1</small></li></ul></ul><li><span class='object_link'><a href="Auth0/BadRequest.html" title="Auth0::BadRequest (class)">BadRequest</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Client.html" title="Auth0::Client (class)">Client</a></span> < Object<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Exception.html" title="Auth0::Exception (class)">Exception</a></span> < StandardError<small class='search_info'>Auth0</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Mixins.html" title="Auth0::Mixins (module)">Mixins</a></span><small class='search_info'>Auth0</small></li><ul><li><span class='object_link'><a href="Auth0/Mixins/HTTPartyProxy.html" title="Auth0::Mixins::HTTPartyProxy (module)">HTTPartyProxy</a></span><small class='search_info'>Auth0::Mixins</small></li><li><span class='object_link'><a href="Auth0/Mixins/Initializer.html" title="Auth0::Mixins::Initializer (module)">Initializer</a></span><small class='search_info'>Auth0::Mixins</small></li></ul><li><span class='object_link'><a href="Auth0/NotFound.html" title="Auth0::NotFound (class)">NotFound</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/ServerError.html" title="Auth0::ServerError (class)">ServerError</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Unauthorized.html" title="Auth0::Unauthorized (class)">Unauthorized</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Unsupported.html" title="Auth0::Unsupported (class)">Unsupported</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/UserIdIsBlank.html" title="Auth0::UserIdIsBlank (class)">UserIdIsBlank</a></span> < Exception<small class='search_info'>Auth0</small></li></ul><li><span class='object_link'><a href="Auth0Client.html" title="Auth0Client (class)">Auth0Client</a></span> < Client<small class='search_info'>Top Level Namespace</small></li>
|
53
|
+
<li><a class='toggle'></a> <span class='object_link'><a href="Auth0.html" title="Auth0 (module)">Auth0</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Api.html" title="Auth0::Api (module)">Api</a></span><small class='search_info'>Auth0</small></li><ul><li><span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html" title="Auth0::Api::AuthenticationEndpoints (module)">AuthenticationEndpoints</a></span><small class='search_info'>Auth0::Api</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Api/V1.html" title="Auth0::Api::V1 (module)">V1</a></span><small class='search_info'>Auth0::Api</small></li><ul><li><span class='object_link'><a href="Auth0/Api/V1/Clients.html" title="Auth0::Api::V1::Clients (module)">Clients</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Connections.html" title="Auth0::Api::V1::Connections (module)">Connections</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Logs.html" title="Auth0::Api::V1::Logs (module)">Logs</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Rules.html" title="Auth0::Api::V1::Rules (module)">Rules</a></span><small class='search_info'>Auth0::Api::V1</small></li><li><span class='object_link'><a href="Auth0/Api/V1/Users.html" title="Auth0::Api::V1::Users (module)">Users</a></span><small class='search_info'>Auth0::Api::V1</small></li></ul></ul><li><span class='object_link'><a href="Auth0/BadRequest.html" title="Auth0::BadRequest (class)">BadRequest</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Client.html" title="Auth0::Client (class)">Client</a></span> < Object<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Exception.html" title="Auth0::Exception (class)">Exception</a></span> < StandardError<small class='search_info'>Auth0</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Auth0/Mixins.html" title="Auth0::Mixins (module)">Mixins</a></span><small class='search_info'>Auth0</small></li><ul><li><span class='object_link'><a href="Auth0/Mixins/HTTPartyProxy.html" title="Auth0::Mixins::HTTPartyProxy (module)">HTTPartyProxy</a></span><small class='search_info'>Auth0::Mixins</small></li><li><span class='object_link'><a href="Auth0/Mixins/Initializer.html" title="Auth0::Mixins::Initializer (module)">Initializer</a></span><small class='search_info'>Auth0::Mixins</small></li><li><span class='object_link'><a href="Auth0/Mixins/JwtOperations.html" title="Auth0::Mixins::JwtOperations (module)">JwtOperations</a></span><small class='search_info'>Auth0::Mixins</small></li></ul><li><span class='object_link'><a href="Auth0/NotFound.html" title="Auth0::NotFound (class)">NotFound</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/ServerError.html" title="Auth0::ServerError (class)">ServerError</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Unauthorized.html" title="Auth0::Unauthorized (class)">Unauthorized</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/Unsupported.html" title="Auth0::Unsupported (class)">Unsupported</a></span> < Exception<small class='search_info'>Auth0</small></li><li><span class='object_link'><a href="Auth0/UserIdIsBlank.html" title="Auth0::UserIdIsBlank (class)">UserIdIsBlank</a></span> < Exception<small class='search_info'>Auth0</small></li></ul><li><span class='object_link'><a href="Auth0Client.html" title="Auth0Client (class)">Auth0Client</a></span> < Client<small class='search_info'>Top Level Namespace</small></li>
|
54
54
|
|
55
55
|
</ul>
|
56
56
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -94,7 +94,7 @@ href="https://github.com/auth0/omniauth-auth0">omniauth-auth0</a>.</p>
|
|
94
94
|
</div></div>
|
95
95
|
|
96
96
|
<div id="footer">
|
97
|
-
Generated on
|
97
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
98
98
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
99
|
0.8.7.6 (ruby-2.0.0).
|
100
100
|
</div>
|
data/doc/index.html
CHANGED
@@ -94,7 +94,7 @@ href="https://github.com/auth0/omniauth-auth0">omniauth-auth0</a>.</p>
|
|
94
94
|
</div></div>
|
95
95
|
|
96
96
|
<div id="footer">
|
97
|
-
Generated on
|
97
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
98
98
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
99
|
0.8.7.6 (ruby-2.0.0).
|
100
100
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -124,198 +124,204 @@
|
|
124
124
|
|
125
125
|
|
126
126
|
<li class="r1 ">
|
127
|
+
<span class='object_link'><a href="Auth0/Mixins/JwtOperations.html#decode_jwt-instance_method" title="Auth0::Mixins::JwtOperations#decode_jwt (method)">#decode_jwt</a></span>
|
128
|
+
<small>Auth0::Mixins::JwtOperations</small>
|
129
|
+
</li>
|
130
|
+
|
131
|
+
|
132
|
+
<li class="r2 ">
|
127
133
|
<span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html#delegation-instance_method" title="Auth0::Api::AuthenticationEndpoints#delegation (method)">#delegation</a></span>
|
128
134
|
<small>Auth0::Api::AuthenticationEndpoints</small>
|
129
135
|
</li>
|
130
136
|
|
131
137
|
|
132
|
-
<li class="
|
138
|
+
<li class="r1 ">
|
133
139
|
<span class='object_link'><a href="Auth0/Api/V1/Connections.html#delete_connection-instance_method" title="Auth0::Api::V1::Connections#delete_connection (method)">#delete_connection</a></span>
|
134
140
|
<small>Auth0::Api::V1::Connections</small>
|
135
141
|
</li>
|
136
142
|
|
137
143
|
|
138
|
-
<li class="
|
144
|
+
<li class="r2 ">
|
139
145
|
<span class='object_link'><a href="Auth0/Api/V1/Rules.html#delete_rule-instance_method" title="Auth0::Api::V1::Rules#delete_rule (method)">#delete_rule</a></span>
|
140
146
|
<small>Auth0::Api::V1::Rules</small>
|
141
147
|
</li>
|
142
148
|
|
143
149
|
|
144
|
-
<li class="
|
150
|
+
<li class="r1 ">
|
145
151
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#delete_user-instance_method" title="Auth0::Api::V1::Users#delete_user (method)">#delete_user</a></span>
|
146
152
|
<small>Auth0::Api::V1::Users</small>
|
147
153
|
</li>
|
148
154
|
|
149
155
|
|
150
|
-
<li class="
|
156
|
+
<li class="r2 ">
|
151
157
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#delete_users-instance_method" title="Auth0::Api::V1::Users#delete_users (method)">#delete_users</a></span>
|
152
158
|
<small>Auth0::Api::V1::Users</small>
|
153
159
|
</li>
|
154
160
|
|
155
161
|
|
156
|
-
<li class="
|
162
|
+
<li class="r1 ">
|
157
163
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#enterpriseconnections_users-instance_method" title="Auth0::Api::V1::Users#enterpriseconnections_users (method)">#enterpriseconnections_users</a></span>
|
158
164
|
<small>Auth0::Api::V1::Users</small>
|
159
165
|
</li>
|
160
166
|
|
161
167
|
|
162
|
-
<li class="
|
168
|
+
<li class="r2 ">
|
163
169
|
<span class='object_link'><a href="Auth0/Mixins/Initializer.html#included-class_method" title="Auth0::Mixins::Initializer.included (method)">included</a></span>
|
164
170
|
<small>Auth0::Mixins::Initializer</small>
|
165
171
|
</li>
|
166
172
|
|
167
173
|
|
168
|
-
<li class="
|
174
|
+
<li class="r1 ">
|
169
175
|
<span class='object_link'><a href="Auth0/Mixins/Initializer.html#initialize-instance_method" title="Auth0::Mixins::Initializer#initialize (method)">#initialize</a></span>
|
170
176
|
<small>Auth0::Mixins::Initializer</small>
|
171
177
|
</li>
|
172
178
|
|
173
179
|
|
174
|
-
<li class="
|
180
|
+
<li class="r2 ">
|
175
181
|
<span class='object_link'><a href="Auth0/Api/V1/Logs.html#log-instance_method" title="Auth0::Api::V1::Logs#log (method)">#log</a></span>
|
176
182
|
<small>Auth0::Api::V1::Logs</small>
|
177
183
|
</li>
|
178
184
|
|
179
185
|
|
180
|
-
<li class="
|
186
|
+
<li class="r1 ">
|
181
187
|
<span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html#login-instance_method" title="Auth0::Api::AuthenticationEndpoints#login (method)">#login</a></span>
|
182
188
|
<small>Auth0::Api::AuthenticationEndpoints</small>
|
183
189
|
</li>
|
184
190
|
|
185
191
|
|
186
|
-
<li class="
|
192
|
+
<li class="r2 ">
|
187
193
|
<span class='object_link'><a href="Auth0/Api/V1/Logs.html#logs-instance_method" title="Auth0::Api::V1::Logs#logs (method)">#logs</a></span>
|
188
194
|
<small>Auth0::Api::V1::Logs</small>
|
189
195
|
</li>
|
190
196
|
|
191
197
|
|
192
|
-
<li class="
|
198
|
+
<li class="r1 ">
|
193
199
|
<span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html#obtain_access_token-instance_method" title="Auth0::Api::AuthenticationEndpoints#obtain_access_token (method)">#obtain_access_token</a></span>
|
194
200
|
<small>Auth0::Api::AuthenticationEndpoints</small>
|
195
201
|
</li>
|
196
202
|
|
197
203
|
|
198
|
-
<li class="
|
204
|
+
<li class="r2 ">
|
199
205
|
<span class='object_link'><a href="Auth0/Api/V1/Clients.html#patch_client-instance_method" title="Auth0::Api::V1::Clients#patch_client (method)">#patch_client</a></span>
|
200
206
|
<small>Auth0::Api::V1::Clients</small>
|
201
207
|
</li>
|
202
208
|
|
203
209
|
|
204
|
-
<li class="
|
210
|
+
<li class="r1 ">
|
205
211
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#patch_user_metadata-instance_method" title="Auth0::Api::V1::Users#patch_user_metadata (method)">#patch_user_metadata</a></span>
|
206
212
|
<small>Auth0::Api::V1::Users</small>
|
207
213
|
</li>
|
208
214
|
|
209
215
|
|
210
|
-
<li class="
|
216
|
+
<li class="r2 ">
|
211
217
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#revoke_user_device_public_key-instance_method" title="Auth0::Api::V1::Users#revoke_user_device_public_key (method)">#revoke_user_device_public_key</a></span>
|
212
218
|
<small>Auth0::Api::V1::Users</small>
|
213
219
|
</li>
|
214
220
|
|
215
221
|
|
216
|
-
<li class="
|
222
|
+
<li class="r1 ">
|
217
223
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#revoke_user_refresh_token-instance_method" title="Auth0::Api::V1::Users#revoke_user_refresh_token (method)">#revoke_user_refresh_token</a></span>
|
218
224
|
<small>Auth0::Api::V1::Users</small>
|
219
225
|
</li>
|
220
226
|
|
221
227
|
|
222
|
-
<li class="
|
228
|
+
<li class="r2 ">
|
223
229
|
<span class='object_link'><a href="Auth0/Api/V1/Rules.html#rules-instance_method" title="Auth0::Api::V1::Rules#rules (method)">#rules</a></span>
|
224
230
|
<small>Auth0::Api::V1::Rules</small>
|
225
231
|
</li>
|
226
232
|
|
227
233
|
|
228
|
-
<li class="
|
234
|
+
<li class="r1 ">
|
229
235
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#send_verification_email-instance_method" title="Auth0::Api::V1::Users#send_verification_email (method)">#send_verification_email</a></span>
|
230
236
|
<small>Auth0::Api::V1::Users</small>
|
231
237
|
</li>
|
232
238
|
|
233
239
|
|
234
|
-
<li class="
|
240
|
+
<li class="r2 ">
|
235
241
|
<span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html#signup-instance_method" title="Auth0::Api::AuthenticationEndpoints#signup (method)">#signup</a></span>
|
236
242
|
<small>Auth0::Api::AuthenticationEndpoints</small>
|
237
243
|
</li>
|
238
244
|
|
239
245
|
|
240
|
-
<li class="
|
246
|
+
<li class="r1 ">
|
241
247
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#socialconnections_users-instance_method" title="Auth0::Api::V1::Users#socialconnections_users (method)">#socialconnections_users</a></span>
|
242
248
|
<small>Auth0::Api::V1::Users</small>
|
243
249
|
</li>
|
244
250
|
|
245
251
|
|
246
|
-
<li class="
|
252
|
+
<li class="r2 ">
|
247
253
|
<span class='object_link'><a href="Auth0/Api/AuthenticationEndpoints.html#token_info-instance_method" title="Auth0::Api::AuthenticationEndpoints#token_info (method)">#token_info</a></span>
|
248
254
|
<small>Auth0::Api::AuthenticationEndpoints</small>
|
249
255
|
</li>
|
250
256
|
|
251
257
|
|
252
|
-
<li class="
|
258
|
+
<li class="r1 deprecated">
|
253
259
|
<span class='object_link'><a href="Auth0/Api/V1/Clients.html#update_client-instance_method" title="Auth0::Api::V1::Clients#update_client (method)">#update_client</a></span>
|
254
260
|
<small>Auth0::Api::V1::Clients</small>
|
255
261
|
</li>
|
256
262
|
|
257
263
|
|
258
|
-
<li class="
|
264
|
+
<li class="r2 ">
|
259
265
|
<span class='object_link'><a href="Auth0/Api/V1/Connections.html#update_connection-instance_method" title="Auth0::Api::V1::Connections#update_connection (method)">#update_connection</a></span>
|
260
266
|
<small>Auth0::Api::V1::Connections</small>
|
261
267
|
</li>
|
262
268
|
|
263
269
|
|
264
|
-
<li class="
|
270
|
+
<li class="r1 ">
|
265
271
|
<span class='object_link'><a href="Auth0/Api/V1/Rules.html#update_rule-instance_method" title="Auth0::Api::V1::Rules#update_rule (method)">#update_rule</a></span>
|
266
272
|
<small>Auth0::Api::V1::Rules</small>
|
267
273
|
</li>
|
268
274
|
|
269
275
|
|
270
|
-
<li class="
|
276
|
+
<li class="r2 ">
|
271
277
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#update_user_email-instance_method" title="Auth0::Api::V1::Users#update_user_email (method)">#update_user_email</a></span>
|
272
278
|
<small>Auth0::Api::V1::Users</small>
|
273
279
|
</li>
|
274
280
|
|
275
281
|
|
276
|
-
<li class="
|
282
|
+
<li class="r1 ">
|
277
283
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#update_user_metadata-instance_method" title="Auth0::Api::V1::Users#update_user_metadata (method)">#update_user_metadata</a></span>
|
278
284
|
<small>Auth0::Api::V1::Users</small>
|
279
285
|
</li>
|
280
286
|
|
281
287
|
|
282
|
-
<li class="
|
288
|
+
<li class="r2 ">
|
283
289
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#update_user_password-instance_method" title="Auth0::Api::V1::Users#update_user_password (method)">#update_user_password</a></span>
|
284
290
|
<small>Auth0::Api::V1::Users</small>
|
285
291
|
</li>
|
286
292
|
|
287
293
|
|
288
|
-
<li class="
|
294
|
+
<li class="r1 ">
|
289
295
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#update_user_password_using_email-instance_method" title="Auth0::Api::V1::Users#update_user_password_using_email (method)">#update_user_password_using_email</a></span>
|
290
296
|
<small>Auth0::Api::V1::Users</small>
|
291
297
|
</li>
|
292
298
|
|
293
299
|
|
294
|
-
<li class="
|
300
|
+
<li class="r2 ">
|
295
301
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#user-instance_method" title="Auth0::Api::V1::Users#user (method)">#user</a></span>
|
296
302
|
<small>Auth0::Api::V1::Users</small>
|
297
303
|
</li>
|
298
304
|
|
299
305
|
|
300
|
-
<li class="
|
306
|
+
<li class="r1 ">
|
301
307
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#user_devices-instance_method" title="Auth0::Api::V1::Users#user_devices (method)">#user_devices</a></span>
|
302
308
|
<small>Auth0::Api::V1::Users</small>
|
303
309
|
</li>
|
304
310
|
|
305
311
|
|
306
|
-
<li class="
|
312
|
+
<li class="r2 ">
|
307
313
|
<span class='object_link'><a href="Auth0/Api/V1/Logs.html#user_logs-instance_method" title="Auth0::Api::V1::Logs#user_logs (method)">#user_logs</a></span>
|
308
314
|
<small>Auth0::Api::V1::Logs</small>
|
309
315
|
</li>
|
310
316
|
|
311
317
|
|
312
|
-
<li class="
|
318
|
+
<li class="r1 ">
|
313
319
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#users-instance_method" title="Auth0::Api::V1::Users#users (method)">#users</a></span>
|
314
320
|
<small>Auth0::Api::V1::Users</small>
|
315
321
|
</li>
|
316
322
|
|
317
323
|
|
318
|
-
<li class="
|
324
|
+
<li class="r2 ">
|
319
325
|
<span class='object_link'><a href="Auth0/Api/V1/Users.html#verification_ticket-instance_method" title="Auth0::Api::V1::Users#verification_ticket (method)">#verification_ticket</a></span>
|
320
326
|
<small>Auth0::Api::V1::Users</small>
|
321
327
|
</li>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Wed Feb 4 17:42:51 2015 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
110
|
0.8.7.6 (ruby-2.0.0).
|
111
111
|
</div>
|
@@ -7,12 +7,16 @@ module Auth0
|
|
7
7
|
# you can get all required fields from here: https://auth0.com/docs/auth-api
|
8
8
|
def initialize(config)
|
9
9
|
options = Hash[config.map{|(k,v)| [k.to_sym,v]}]
|
10
|
-
self.class.base_uri "https
|
10
|
+
self.class.base_uri "https://"+options[:namespace].to_s
|
11
11
|
self.class.headers "Content-Type" => 'application/json'
|
12
12
|
@client_id = options[:client_id]
|
13
13
|
@client_secret = options[:client_secret]
|
14
14
|
@token = obtain_access_token
|
15
15
|
self.class.headers "Authorization" => "Bearer #{@token}"
|
16
|
+
if options[:jwt]
|
17
|
+
require 'auth0/mixins/jwt_operations'
|
18
|
+
self.class.send(:include, Auth0::Mixins::JwtOperations)
|
19
|
+
end
|
16
20
|
end
|
17
21
|
|
18
22
|
# including initializer in top of klass
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'jwt'
|
2
|
+
module Auth0
|
3
|
+
module Mixins
|
4
|
+
# Working with JWT
|
5
|
+
#
|
6
|
+
# https://auth0.com/docs/jwt
|
7
|
+
module JwtOperations
|
8
|
+
# https://auth0.com/docs/server-apis/ruby
|
9
|
+
def decode_jwt(token, client_secret=@client_secret)
|
10
|
+
JWT.decode(token,Base64.decode64(client_secret.tr("-_","+/")))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/auth0/version.rb
CHANGED
@@ -15,5 +15,12 @@ describe Auth0::Client do
|
|
15
15
|
it {expect(subject).to be_a Auth0::Api::V1::Rules}
|
16
16
|
it {expect(subject).to be_a Auth0::Api::V1::Logs}
|
17
17
|
it {expect(subject).to be_a Auth0::Api::AuthenticationEndpoints}
|
18
|
+
context "JwtOperations should be included optionally" do
|
19
|
+
it {expect(subject).not_to be_a Auth0::Mixins::JwtOperations}
|
20
|
+
it "should include JwtOperations if jwt flag is set" do
|
21
|
+
client = Auth0::Client.new(jwt: true)
|
22
|
+
expect(client).to be_a Auth0::Mixins::JwtOperations
|
23
|
+
end
|
24
|
+
end
|
18
25
|
end
|
19
26
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Auth0::Mixins::JwtOperations do
|
3
|
+
let(:client_secret){"/-_+Authentic--++_"}
|
4
|
+
let(:subject){StubClassWithClientSecret.new(client_secret)}
|
5
|
+
let(:token){"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJteV9zZWNyZXQiOiJTb21lIGV4dHJlbWVseSBzZWNyZXQgZGF0YSJ9.2jD3ndQO7hTx1gfrYsrPst9WiibigORevZ_lUaNA8fY"}
|
6
|
+
let(:escaped_client_secret) {"/+/+Authentic++++/"}
|
7
|
+
let(:base64_decoded_client_secret){Base64.decode64(escaped_client_secret)}
|
8
|
+
let(:decrypted_value){[{"my_secret"=>"Some extremely secret data"}, {"typ"=>"JWT", "alg"=>"HS256"}]}
|
9
|
+
context "#decode" do
|
10
|
+
it { expect(subject).to respond_to :decode_jwt}
|
11
|
+
it "is expected to call tr on client secret" do
|
12
|
+
allow(JWT).to receive(:decode)
|
13
|
+
allow(Base64).to receive(:decode64)
|
14
|
+
expect(subject.client_secret).to receive(:tr).with("-_","+/")
|
15
|
+
expect{subject.decode_jwt(token)}.not_to raise_error
|
16
|
+
end
|
17
|
+
it "is expected to send decode64 to Base64" do
|
18
|
+
allow(JWT).to receive(:decode)
|
19
|
+
expect(Base64).to receive(:decode64).with(escaped_client_secret)
|
20
|
+
expect{subject.decode_jwt(token)}.not_to raise_error
|
21
|
+
end
|
22
|
+
it "is expected to send decode to JWT" do
|
23
|
+
allow(JWT).to receive(:decode).with(token,base64_decoded_client_secret)
|
24
|
+
expect{subject.decode_jwt(token)}.not_to raise_error
|
25
|
+
end
|
26
|
+
it "is expected to return decrypted_value after decryption" do
|
27
|
+
expect(subject.decode_jwt(token)).to eql decrypted_value
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth0-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-02-
|
14
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|
@@ -131,6 +131,20 @@ dependencies:
|
|
131
131
|
- - '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
|
+
- !ruby/object:Gem::Dependency
|
135
|
+
name: jwt
|
136
|
+
requirement: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
type: :development
|
142
|
+
prerelease: false
|
143
|
+
version_requirements: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - '>='
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
134
148
|
description: Ruby client library for the Auth0 platform. This is fork of https://github.com/auth0/ruby-auth0,
|
135
149
|
but while auth0 is not hurring to merge prs, I've decided to make my own gem with
|
136
150
|
blackjack and hookers. But I really recommend you to switch to ruby-auth0 gem after
|
@@ -164,6 +178,7 @@ files:
|
|
164
178
|
- doc/Auth0/Mixins.html
|
165
179
|
- doc/Auth0/Mixins/HTTPartyProxy.html
|
166
180
|
- doc/Auth0/Mixins/Initializer.html
|
181
|
+
- doc/Auth0/Mixins/JwtOperations.html
|
167
182
|
- doc/Auth0/NotFound.html
|
168
183
|
- doc/Auth0/ServerError.html
|
169
184
|
- doc/Auth0/Unauthorized.html
|
@@ -197,6 +212,7 @@ files:
|
|
197
212
|
- lib/auth0/mixins.rb
|
198
213
|
- lib/auth0/mixins/httparty_proxy.rb
|
199
214
|
- lib/auth0/mixins/initializer.rb
|
215
|
+
- lib/auth0/mixins/jwt_operations.rb
|
200
216
|
- lib/auth0/version.rb
|
201
217
|
- lib/auth0_client.rb
|
202
218
|
- spec/lib/auth0/api/authentication_endpoints_spec.rb
|
@@ -207,10 +223,12 @@ files:
|
|
207
223
|
- spec/lib/auth0/api/v1/users_spec.rb
|
208
224
|
- spec/lib/auth0/client_spec.rb
|
209
225
|
- spec/lib/auth0/mixins/httparty_proxy_spec.rb
|
226
|
+
- spec/lib/auth0/mixins/jwt_operations_spec.rb
|
210
227
|
- spec/lib/auth0_client_spec.rb
|
211
228
|
- spec/spec_helper.rb
|
212
229
|
- spec/support/dummy_class.rb
|
213
230
|
- spec/support/dummy_class_for_proxy.rb
|
231
|
+
- spec/support/stub_class_with_client_secret.rb
|
214
232
|
- spec/support/stub_response.rb
|
215
233
|
homepage: https://github.com/offtop/ruby-auth0
|
216
234
|
licenses:
|
@@ -224,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
224
242
|
requirements:
|
225
243
|
- - '>='
|
226
244
|
- !ruby/object:Gem::Version
|
227
|
-
version:
|
245
|
+
version: 1.9.3
|
228
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
247
|
requirements:
|
230
248
|
- - '>='
|
@@ -245,9 +263,11 @@ test_files:
|
|
245
263
|
- spec/lib/auth0/api/v1/users_spec.rb
|
246
264
|
- spec/lib/auth0/client_spec.rb
|
247
265
|
- spec/lib/auth0/mixins/httparty_proxy_spec.rb
|
266
|
+
- spec/lib/auth0/mixins/jwt_operations_spec.rb
|
248
267
|
- spec/lib/auth0_client_spec.rb
|
249
268
|
- spec/spec_helper.rb
|
250
269
|
- spec/support/dummy_class.rb
|
251
270
|
- spec/support/dummy_class_for_proxy.rb
|
271
|
+
- spec/support/stub_class_with_client_secret.rb
|
252
272
|
- spec/support/stub_response.rb
|
253
273
|
has_rdoc:
|