workos 0.0.1

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.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +49 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +10 -0
  5. data/.ruby-version +1 -0
  6. data/.semaphore/rubygems.yml +19 -0
  7. data/.semaphore/semaphore.yml +63 -0
  8. data/CODEOWNERS +1 -0
  9. data/Gemfile +5 -0
  10. data/Gemfile.lock +84 -0
  11. data/LICENSE +21 -0
  12. data/README.md +21 -0
  13. data/bin/build +3 -0
  14. data/bin/console +3 -0
  15. data/bin/docs +5 -0
  16. data/bin/publish +3 -0
  17. data/codecov.yml +11 -0
  18. data/docs/WorkOS.html +328 -0
  19. data/docs/WorkOS/Base.html +281 -0
  20. data/docs/WorkOS/Profile.html +725 -0
  21. data/docs/WorkOS/RequestError.html +135 -0
  22. data/docs/WorkOS/SSO.html +511 -0
  23. data/docs/WorkOS/Types.html +129 -0
  24. data/docs/WorkOS/Types/ProfileStruct.html +135 -0
  25. data/docs/class_list.html +51 -0
  26. data/docs/css/common.css +1 -0
  27. data/docs/css/full_list.css +58 -0
  28. data/docs/css/style.css +496 -0
  29. data/docs/file.README.html +92 -0
  30. data/docs/file_list.html +56 -0
  31. data/docs/frames.html +17 -0
  32. data/docs/index.html +189 -0
  33. data/docs/js/app.js +303 -0
  34. data/docs/js/full_list.js +216 -0
  35. data/docs/js/jquery.js +4 -0
  36. data/docs/method_list.html +171 -0
  37. data/docs/top-level-namespace.html +110 -0
  38. data/lib/workos.rb +36 -0
  39. data/lib/workos/base.rb +18 -0
  40. data/lib/workos/profile.rb +53 -0
  41. data/lib/workos/request_error.rb +5 -0
  42. data/lib/workos/sso.rb +142 -0
  43. data/lib/workos/types.rb +11 -0
  44. data/lib/workos/types/profile_struct.rb +18 -0
  45. data/lib/workos/version.rb +7 -0
  46. data/sorbet/config +2 -0
  47. data/sorbet/rbi/gems/addressable.rbi +198 -0
  48. data/sorbet/rbi/gems/ast.rbi +47 -0
  49. data/sorbet/rbi/gems/codecov.rbi +19 -0
  50. data/sorbet/rbi/gems/crack.rbi +47 -0
  51. data/sorbet/rbi/gems/docile.rbi +31 -0
  52. data/sorbet/rbi/gems/hashdiff.rbi +65 -0
  53. data/sorbet/rbi/gems/jaro_winkler.rbi +14 -0
  54. data/sorbet/rbi/gems/parallel.rbi +81 -0
  55. data/sorbet/rbi/gems/parser.rbi +856 -0
  56. data/sorbet/rbi/gems/public_suffix.rbi +102 -0
  57. data/sorbet/rbi/gems/rack.rbi +103 -0
  58. data/sorbet/rbi/gems/rainbow.rbi +117 -0
  59. data/sorbet/rbi/gems/rake.rbi +632 -0
  60. data/sorbet/rbi/gems/rspec-core.rbi +1661 -0
  61. data/sorbet/rbi/gems/rspec-expectations.rbi +388 -0
  62. data/sorbet/rbi/gems/rspec-mocks.rbi +823 -0
  63. data/sorbet/rbi/gems/rspec-support.rbi +266 -0
  64. data/sorbet/rbi/gems/rspec.rbi +14 -0
  65. data/sorbet/rbi/gems/rubocop.rbi +7083 -0
  66. data/sorbet/rbi/gems/ruby-progressbar.rbi +304 -0
  67. data/sorbet/rbi/gems/simplecov-html.rbi +30 -0
  68. data/sorbet/rbi/gems/simplecov.rbi +225 -0
  69. data/sorbet/rbi/gems/unicode-display_width.rbi +16 -0
  70. data/sorbet/rbi/gems/webmock.rbi +526 -0
  71. data/sorbet/rbi/hidden-definitions/errors.txt +6061 -0
  72. data/sorbet/rbi/hidden-definitions/hidden.rbi +10087 -0
  73. data/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +8684 -0
  74. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +254 -0
  75. data/sorbet/rbi/sorbet-typed/lib/ruby/all/gem.rbi +4222 -0
  76. data/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +111 -0
  77. data/sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi +543 -0
  78. data/sorbet/rbi/todo.rbi +7 -0
  79. data/spec/lib/workos/sso_spec.rb +95 -0
  80. data/spec/spec_helper.rb +32 -0
  81. data/spec/support/profile.txt +1 -0
  82. data/workos.gemspec +32 -0
  83. metadata +261 -0
@@ -0,0 +1,135 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: WorkOS::RequestError
8
+
9
+ &mdash; Documentation by YARD 0.9.20
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
+ pathId = "WorkOS::RequestError";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span>
41
+ &raquo;
42
+ <span class="title">RequestError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Exception: WorkOS::RequestError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">StandardError</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">StandardError</li>
78
+
79
+ <li class="next">WorkOS::RequestError</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/workos/request_error.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Raised when an API request is unsuccessful</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ </div>
126
+
127
+ <div id="footer">
128
+ Generated on Thu Dec 12 17:06:04 2019 by
129
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
+ 0.9.20 (ruby-2.4.9).
131
+ </div>
132
+
133
+ </div>
134
+ </body>
135
+ </html>
@@ -0,0 +1,511 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: WorkOS::SSO
8
+
9
+ &mdash; Documentation by YARD 0.9.20
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
+ pathId = "WorkOS::SSO";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span>
41
+ &raquo;
42
+ <span class="title">SSO</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: WorkOS::SSO
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+ <dl>
73
+ <dt>Extended by:</dt>
74
+ <dd>T::Sig</dd>
75
+ </dl>
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/workos/sso.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+
94
+ <p>The SSO module provides convenience methods for working with the WorkOS SSO
95
+ service. You&#39;ll need a valid API key, a project ID, and to have created
96
+ an SSO connection on your WorkOS dashboard.</p>
97
+
98
+
99
+ </div>
100
+ </div>
101
+ <div class="tags">
102
+
103
+
104
+ <p class="tag_title">See Also:</p>
105
+ <ul class="see">
106
+
107
+ <li><a href="https://dashboard.workos.com/docs/sso/what-is-sso" target="_parent" title="https://dashboard.workos.com/docs/sso/what-is-sso">https://dashboard.workos.com/docs/sso/what-is-sso</a></li>
108
+
109
+ </ul>
110
+
111
+ </div>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <h2>
120
+ Class Method Summary
121
+ <small><a href="#" class="summary_toggle">collapse</a></small>
122
+ </h2>
123
+
124
+ <ul class="summary">
125
+
126
+ <li class="public ">
127
+ <span class="summary_signature">
128
+
129
+ <a href="#authorization_url-class_method" title="authorization_url (class method)">.<strong>authorization_url</strong>(domain:, project_id:, redirect_uri:, state: {}) &#x21d2; String </a>
130
+
131
+
132
+
133
+ </span>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'>
144
+ <p>Generate an Oauth2 authorization URL where your users will authenticate
145
+ using the configured SSO Identity Provider.</p>
146
+ </div></span>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#profile-class_method" title="profile (class method)">.<strong>profile</strong>(code:, project_id:, redirect_uri:) &#x21d2; WorkOS::Profile </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'>
169
+ <p>Fetch the profile details for the authenticated SSO user.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ </ul>
176
+
177
+
178
+
179
+
180
+
181
+ <div id="class_method_details" class="method_details_list">
182
+ <h2>Class Method Details</h2>
183
+
184
+
185
+ <div class="method_details first">
186
+ <h3 class="signature first" id="authorization_url-class_method">
187
+
188
+ .<strong>authorization_url</strong>(domain:, project_id:, redirect_uri:, state: {}) &#x21d2; <tt>String</tt>
189
+
190
+
191
+
192
+
193
+
194
+ </h3><div class="docstring">
195
+ <div class="discussion">
196
+
197
+ <p>Generate an Oauth2 authorization URL where your users will authenticate
198
+ using the configured SSO Identity Provider.</p>
199
+
200
+
201
+ </div>
202
+ </div>
203
+ <div class="tags">
204
+
205
+ <div class="examples">
206
+ <p class="tag_title">Examples:</p>
207
+
208
+
209
+ <pre class="example code"><code>WorkOS::SSO.authorization_url(
210
+ domain: &#39;acme.com&#39;,
211
+ project_id: &#39;project_01DG5TGK363GRVXP3ZS40WNGEZ&#39;,
212
+ redirect_uri: &#39;https://workos.com/callback&#39;,
213
+ state: {
214
+ next_page: &#39;/docs&#39;
215
+ }
216
+ )
217
+
218
+ =&gt; &quot;https://api.workos.com/sso/authorize?domain=acme.com&quot; \
219
+ &quot;&amp;client_id=project_01DG5TGK363GRVXP3ZS40WNGEZ&quot; \
220
+ &quot;&amp;redirect_uri=https%3A%2F%2Fworkos.com%2Fcallback&amp;&quot; \
221
+ &quot;response_type=code&amp;state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D&quot;</code></pre>
222
+
223
+ </div>
224
+ <p class="tag_title">Parameters:</p>
225
+ <ul class="param">
226
+
227
+ <li>
228
+
229
+ <span class='name'>domain</span>
230
+
231
+
232
+ <span class='type'>(<tt>String</tt>)</span>
233
+
234
+
235
+
236
+ &mdash;
237
+ <div class='inline'>
238
+ <p>The domain for the relevant SSO Connection configured on your WorkOS
239
+ dashboard</p>
240
+ </div>
241
+
242
+ </li>
243
+
244
+ <li>
245
+
246
+ <span class='name'>project_id</span>
247
+
248
+
249
+ <span class='type'>(<tt>String</tt>)</span>
250
+
251
+
252
+
253
+ &mdash;
254
+ <div class='inline'>
255
+ <p>The WorkOS project ID for the project where you&#39;ve configured your SSO
256
+ connection</p>
257
+ </div>
258
+
259
+ </li>
260
+
261
+ <li>
262
+
263
+ <span class='name'>redirect_uri</span>
264
+
265
+
266
+ <span class='type'>(<tt>String</tt>)</span>
267
+
268
+
269
+
270
+ &mdash;
271
+ <div class='inline'>
272
+ <p>The URI where users are directed after completing the authentication step.
273
+ Must match a configured redirect URI on your WorkOS dashboard</p>
274
+ </div>
275
+
276
+ </li>
277
+
278
+ <li>
279
+
280
+ <span class='name'>state</span>
281
+
282
+
283
+ <span class='type'>(<tt>Hash</tt>)</span>
284
+
285
+
286
+
287
+ &mdash;
288
+ <div class='inline'>
289
+ <p>An aribtrary state object that is preserved and available to the client in
290
+ the response.</p>
291
+ </div>
292
+
293
+ </li>
294
+
295
+ </ul>
296
+
297
+ <p class="tag_title">Returns:</p>
298
+ <ul class="return">
299
+
300
+ <li>
301
+
302
+
303
+ <span class='type'>(<tt>String</tt>)</span>
304
+
305
+
306
+
307
+ </li>
308
+
309
+ </ul>
310
+
311
+ </div><table class="source_code">
312
+ <tr>
313
+ <td>
314
+ <pre class="lines">
315
+
316
+
317
+ 56
318
+ 57
319
+ 58
320
+ 59
321
+ 60
322
+ 61
323
+ 62
324
+ 63
325
+ 64
326
+ 65
327
+ 66</pre>
328
+ </td>
329
+ <td>
330
+ <pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 56</span>
331
+
332
+ <span class='kw'>def</span> <span class='id identifier rubyid_authorization_url'>authorization_url</span><span class='lparen'>(</span><span class='label'>domain:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='comma'>,</span> <span class='label'>redirect_uri:</span><span class='comma'>,</span> <span class='label'>state:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
333
+ <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Utils</span><span class='period'>.</span><span class='id identifier rubyid_build_query'>build_query</span><span class='lparen'>(</span>
334
+ <span class='label'>domain:</span> <span class='id identifier rubyid_domain'>domain</span><span class='comma'>,</span>
335
+ <span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
336
+ <span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
337
+ <span class='label'>response_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>code</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
338
+ <span class='label'>state:</span> <span class='id identifier rubyid_state'>state</span><span class='comma'>,</span>
339
+ <span class='rparen'>)</span>
340
+
341
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../WorkOS.html#API_HOSTNAME-constant" title="WorkOS::API_HOSTNAME (constant)">API_HOSTNAME</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/sso/authorize?</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query'>query</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
342
+ <span class='kw'>end</span></pre>
343
+ </td>
344
+ </tr>
345
+ </table>
346
+ </div>
347
+
348
+ <div class="method_details ">
349
+ <h3 class="signature " id="profile-class_method">
350
+
351
+ .<strong>profile</strong>(code:, project_id:, redirect_uri:) &#x21d2; <tt><span class='object_link'><a href="Profile.html" title="WorkOS::Profile (class)">WorkOS::Profile</a></span></tt>
352
+
353
+
354
+
355
+
356
+
357
+ </h3><div class="docstring">
358
+ <div class="discussion">
359
+
360
+ <p>Fetch the profile details for the authenticated SSO user.</p>
361
+
362
+
363
+ </div>
364
+ </div>
365
+ <div class="tags">
366
+
367
+ <div class="examples">
368
+ <p class="tag_title">Examples:</p>
369
+
370
+
371
+ <pre class="example code"><code>WorkOS::SSO.profile(
372
+ code: &#39;acme.com&#39;,
373
+ project_id: &#39;project_01DG5TGK363GRVXP3ZS40WNGEZ&#39;,
374
+ redirect_uri: &#39;https://workos.com/callback&#39;,
375
+ )
376
+ =&gt; #&lt;WorkOS::Profile:0x00007fb6e4193d20
377
+ @id=&quot;prof_01DRA1XNSJDZ19A31F183ECQW5&quot;,
378
+ @email=&quot;demo@workos-okta.com&quot;,
379
+ @first_name=&quot;WorkOS&quot;,
380
+ @connection_type=&quot;OktaSAML&quot;,
381
+ @last_name=&quot;Demo&quot;,
382
+ @idp_id=&quot;00u1klkowm8EGah2H357&quot;,
383
+ @access_token=&quot;01DVX6QBS3EG6FHY2ESAA5Q65X&quot;
384
+ &gt;</code></pre>
385
+
386
+ </div>
387
+ <p class="tag_title">Parameters:</p>
388
+ <ul class="param">
389
+
390
+ <li>
391
+
392
+ <span class='name'>code</span>
393
+
394
+
395
+ <span class='type'>(<tt>String</tt>)</span>
396
+
397
+
398
+
399
+ &mdash;
400
+ <div class='inline'>
401
+ <p>The authorization code provided in the callback URL</p>
402
+ </div>
403
+
404
+ </li>
405
+
406
+ <li>
407
+
408
+ <span class='name'>project_id</span>
409
+
410
+
411
+ <span class='type'>(<tt>String</tt>)</span>
412
+
413
+
414
+
415
+ &mdash;
416
+ <div class='inline'>
417
+ <p>The WorkOS project ID for the project where you&#39;ve configured your SSO
418
+ connection</p>
419
+ </div>
420
+
421
+ </li>
422
+
423
+ <li>
424
+
425
+ <span class='name'>redirect_uri</span>
426
+
427
+
428
+ <span class='type'>(<tt>String</tt>)</span>
429
+
430
+
431
+
432
+ &mdash;
433
+ <div class='inline'>
434
+ <p>The URI where the user was directed after completing the authentication
435
+ step.</p>
436
+ </div>
437
+
438
+ </li>
439
+
440
+ </ul>
441
+
442
+ <p class="tag_title">Returns:</p>
443
+ <ul class="return">
444
+
445
+ <li>
446
+
447
+
448
+ <span class='type'>(<tt><span class='object_link'><a href="Profile.html" title="WorkOS::Profile (class)">WorkOS::Profile</a></span></tt>)</span>
449
+
450
+
451
+
452
+ </li>
453
+
454
+ </ul>
455
+
456
+ </div><table class="source_code">
457
+ <tr>
458
+ <td>
459
+ <pre class="lines">
460
+
461
+
462
+ 101
463
+ 102
464
+ 103
465
+ 104
466
+ 105
467
+ 106
468
+ 107
469
+ 108
470
+ 109
471
+ 110
472
+ 111
473
+ 112
474
+ 113
475
+ 114</pre>
476
+ </td>
477
+ <td>
478
+ <pre class="code"><span class="info file"># File 'lib/workos/sso.rb', line 101</span>
479
+
480
+ <span class='kw'>def</span> <span class='id identifier rubyid_profile'>profile</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>project_id:</span><span class='comma'>,</span> <span class='label'>redirect_uri:</span><span class='rparen'>)</span>
481
+ <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Utils</span><span class='period'>.</span><span class='id identifier rubyid_build_query'>build_query</span><span class='lparen'>(</span>
482
+ <span class='label'>client_id:</span> <span class='id identifier rubyid_project_id'>project_id</span><span class='comma'>,</span>
483
+ <span class='label'>client_secret:</span> <span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key!'><span class='object_link'><a href="../WorkOS.html#key!-class_method" title="WorkOS.key! (method)">key!</a></span></span><span class='comma'>,</span>
484
+ <span class='label'>redirect_uri:</span> <span class='id identifier rubyid_redirect_uri'>redirect_uri</span><span class='comma'>,</span>
485
+ <span class='label'>grant_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>authorization_code</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
486
+ <span class='label'>code:</span> <span class='id identifier rubyid_code'>code</span><span class='comma'>,</span>
487
+ <span class='rparen'>)</span>
488
+
489
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Post</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/sso/token?</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_query'>query</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
490
+ <span class='id identifier rubyid_check_and_raise_error'>check_and_raise_error</span><span class='lparen'>(</span><span class='label'>response:</span> <span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
491
+
492
+ <span class='const'><span class='object_link'><a href="../WorkOS.html" title="WorkOS (module)">WorkOS</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Profile.html" title="WorkOS::Profile (class)">Profile</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Profile.html#initialize-instance_method" title="WorkOS::Profile#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
493
+ <span class='kw'>end</span></pre>
494
+ </td>
495
+ </tr>
496
+ </table>
497
+ </div>
498
+
499
+ </div>
500
+
501
+ </div>
502
+
503
+ <div id="footer">
504
+ Generated on Thu Dec 12 17:06:04 2019 by
505
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
506
+ 0.9.20 (ruby-2.4.9).
507
+ </div>
508
+
509
+ </div>
510
+ </body>
511
+ </html>