-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yaml
832 lines (813 loc) · 23.4 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
openapi: 3.0.0
info:
version: "1.0"
title: "Access OIDC"
license:
name: MIT
servers:
- url: "http://localhost:8787"
description: "localhost"
security:
- OAuth2:
- openid
# - OpenID: []
paths:
/.well-known/openid-configuration:
get:
summary: Provider Configuration
operationId: openid-configuration
security: []
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Configuration"
default:
$ref: "#/components/responses/Default"
/protocol/openid-connect/auth:
get:
summary: Authorization Endpoint
operationId: openid-authorization_endpoint
security: []
# https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
parameters:
- in: query
name: client_id
schema:
type: string
required: true
- in: query
name: redirect_uri
schema:
type: string
format: uri
required: true
- in: query
name: response_type
schema:
type: string
required: true
example: "code"
- in: query
name: scope
schema:
type: string
required: true
example: "openid"
description: 'Requires at least "openid".'
- in: query
name: state
schema:
type: string
format: password
description: "A random string that is returned on success and can be used to verify the call and protect against cross site scripting attacks."
- in: query
name: nonce
schema:
type: string
format: password
description: "A secure random string that is used by the OpenID provider to protect against replay attacks."
- in: query
name: prompt
schema:
type: string
description: |
If used must be set to one of the following:
- **login** - The user will be prompted with a login dialog.
- **none** - The user will not be prompted with a login dialog. If they do not have a current session a **login_required** error will be returned.
- in: query
name: code_challenge_method
schema:
type: string
description: |
Set this to **S256**.
Required when using PKCE.
- in: query
name: code_challenge
schema:
type: string
description: |
A Base64 Url Encoded SHA256 hash of a string that you will be required to send as **code_verifier** when making the second request in the Auth Code Flow.
Required when using PKCE.
# https://openid.net/specs/openid-connect-core-1_0.html#AuthResponse
# https://openid.net/specs/openid-connect-core-1_0.html#AuthError
responses:
302:
description: |
Redirect
If the request parameters are valid a 302 redirect will occur to the registered `redirect_uri` with the following query parameters appended.
Success - User is authenticated
The authorization code is returned with a 10 minute expiry time.
```
?code=M2QyYWU2OGQtNDAxNi00NzQyLTlhYzktMDRmNTY0ZTIyNTZifFPdOVT...&state=61c07cd68b0c65a0e9a35bf6c4f472f4
```
Error - Invalid Response Type
```
?error=unsupported_response_type&error_description=the%20specified%20response_type%20is%20not%20supported
```
Error - Missing the scope parameter
```
?error=invalid_request&error_description=missing%20required%20parameter(s)%20scope
```
Error - Prompt=none and the user was not authenticated
```
?error=login_required&error_description=End-User%20authentication%20is%20required
```
Error - invalid_scope - some of requested scopes are not whitelisted
This indicates that you have supplied scopes that are not official OIDC scopes or not defined as part of an API Authorization Server.
```
?error=invalid_scope&error_description=some%20of%20requested%20scopes%20are%20not%20whitelisted
```
400:
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
missing_redirect_uri:
summary: "Missing `redirect_uri`"
value:
error: "invalid_request"
error_description: "missing required parameter(s) redirect_uri"
401:
$ref: "#/components/responses/Unauthorized"
default:
$ref: "#/components/responses/Default"
/protocol/openid-connect/token:
post:
summary: Token Endpoint
operationId: openid-token_endpoint
security:
- TokenBasic: []
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- code
- grant_type
- redirect_uri
properties:
client_id:
type: string
client_secret:
type: string
format: password
code:
type: string
format: password
code_verifier:
type: string
format: password
grant_type:
type: string
example: "authorization_code"
redirect_uri:
type: string
responses:
200:
$ref: "#/components/responses/Token"
400:
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
resource_not_found:
summary: "Probably an invalid `client_id`"
value:
error: "invalid_request"
error_description: "Resource not found"
grant_invalid:
summary: "The grant has been used or has expired"
value:
error: "invalid_grant"
error_description: "Grant request is invalid"
missing_redirect_uri:
summary: "Missing `redirect_uri`"
value:
error: "invalid_request"
error_description: "Missing required parameter(s). (redirect_uri)"
invalid_authorization:
summary: "The authorization header is invalid"
value:
error: "invalid_request"
error_description: "Invalid authorization header value format"
401:
$ref: "#/components/responses/Unauthorized"
default:
$ref: "#/components/responses/Default"
# https://openid.net/specs/openid-connect-core-1_0.html#UserInfoRequest
/protocol/openid-connect/userinfo:
get:
summary: Get User Info
operationId: oidc-userinfo_endpoint
responses:
# https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
400:
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
no_token_provided:
value:
error: "invalid_request"
error_description: "No bearer token provided"
invalid_authorization:
value:
error: "invalid_request"
error_description: "Invalid authorization header value format"
401:
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
invalid_token:
value:
error: "invalid_token"
error_description: "Invalid token provided"
default:
$ref: "#/components/responses/Default"
post:
summary: Get User Info
operationId: oidc-userinfo_endpoint
responses:
# https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
400:
description: Bad Request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
no_token_provided:
value:
error: "invalid_request"
error_description: "No bearer token provided"
invalid_authorization:
value:
error: "invalid_request"
error_description: "Invalid authorization header value format"
401:
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
invalid_token:
value:
error: "invalid_token"
error_description: "Invalid token provided"
default:
$ref: "#/components/responses/Default"
/protocol/openid-connect/certs:
get:
summary: List Signing Keys
operationId: oidc-jwks_uri
security: []
responses:
200:
description: OK
content:
application/json:
schema:
type: object
required:
- keys
properties:
keys:
type: array
items:
$ref: "#/components/schemas/JWK"
uniqueItems: true
default:
$ref: "#/components/responses/Default"
# https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest
/client-registrations/openid-connect:
get:
summary: List Registered Clients
responses:
200:
description: OK
post:
summary: Dynamic Client Registration
operationId: oidc-registration_endpoint
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ClientMetadata"
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Client"
/client-registrations/openid-connect/{client_id}:
get:
summary: Get Client Information
parameters:
- in: path
name: client_id
schema:
type: string
format: uuid
required: true
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ClientMetadata"
patch:
summary: Update Client Information
parameters:
- in: path
name: client_id
schema:
type: string
format: uuid
required: true
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ClientMetadata"
delete:
summary: Delete Client
parameters:
- in: path
name: client_id
schema:
type: string
format: uuid
required: true
responses:
204:
description: OK
components:
securitySchemes:
OAuth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: /protocol/openid-connect/auth
tokenUrl: /protocol/openid-connect/token
scopes:
openid: OpenID Connect
# OpenID:
# type: openIdConnect
# openIdConnectUrl: /.well-known/openid-configuration
TokenBasic:
type: http
scheme: basic
schemas:
Client:
allOf:
- type: object
required:
- client_id
- client_id_issued_at
properties:
client_id:
type: string
client_id_issued_at:
type: string
format: date-time
client_secret:
type: string
format: password
client_secret_expires_at:
type: string
format: date-time
- $ref: "#/components/schemas/ClientMetadata"
ClientMetadata:
type: object
required:
- redirect_uris
properties:
redirect_uris:
type: array
items:
type: string
format: uri
example:
- https://client.example.org/callback
uniqueItems: true
response_types:
type: array
items:
type: string
enum:
- code
- id_token
- id_token token
default:
- code
uniqueItems: true
grant_types:
type: array
items:
type: string
enum:
- authorization_code
- implicit
- refresh_token
default:
- authorization_code
- implicit
- refresh_token
uniqueItems: true
application_type:
type: string
enum:
- native
- web
default: web
contacts:
type: array
items:
type: string
format: email
example:
- user@example.com
default: [ ]
uniqueItems: true
client_name:
type: string
example: "My Client"
logo_uri:
type: string
format: uri
client_uri:
type: string
format: uri
policy_uri:
type: string
format: uri
tos_uri:
type: string
format: uri
jwks_uri:
type: string
format: uri
description: "Mutually exclusive with `jwks`"
jwks:
type: array
items:
$ref: "#/components/schemas/JWK"
description: "Mutually exclusive with `jwks_uri`"
uniqueItems: true
sector_identifier_uri:
type: string
format: uri
subject_type:
type: string
enum:
- pairwise
- public
default: public
id_token_signed_response_alg:
$ref: "#/components/schemas/JWSAlgorithm"
id_token_encrypted_response_alg:
$ref: "#/components/schemas/JWEAlgorithm"
id_token_encrypted_response_enc:
$ref: "#/components/schemas/JWEEncryption"
userinfo_signed_response_alg:
$ref: "#/components/schemas/JWSAlgorithm"
userinfo_encrypted_response_alg:
$ref: "#/components/schemas/JWEAlgorithm"
userinfo_encrypted_response_enc:
$ref: "#/components/schemas/JWEEncryption"
request_object_signing_alg:
$ref: "#/components/schemas/JWSAlgorithm"
request_object_encryption_alg:
$ref: "#/components/schemas/JWEAlgorithm"
request_object_encryption_enc:
$ref: "#/components/schemas/JWEEncryption"
token_endpoint_auth_method:
type: string
enum:
- client_secret_basic
- client_secret_post
- client_secret_jwt
- private_key_jwt
- none
default: client_secret_basic
token_endpoint_auth_signing_alg:
$ref: "#/components/schemas/JWSAlgorithm"
default_max_age:
type: number
format: int32
default: 0
require_auth_time:
type: boolean
default: false
default_acr_values:
type: array
items:
type: string
uniqueItems: true
initiate_login_uri:
type: string
format: uri
request_uris:
type: array
items:
type: string
format: uri
uniqueItems: true
Configuration:
type: object
required:
- issuer
- authorization_endpoint
- jwks_uri
- response_types_supported
- subject_types_supported
- id_token_signing_alg_values_supported
properties:
issuer:
type: string
example: "http://127.0.0.1:8787"
authorization_endpoint:
type: string
example: "http://127.0.0.1:8787/protocol/openid-connect/auth"
token_endpoint:
type: string
example: "http://127.0.0.1:8787/protocol/openid-connect/token"
userinfo_endpoint:
type: string
example: "http://127.0.0.1:8787/protocol/openid-connect/userinfo"
jwks_uri:
type: string
example: "http://127.0.0.1:8787/protocol/openid-connect/certs"
scopes_supported:
type: array
items:
type: string
example:
- "openid"
uniqueItems: true
response_types_supported:
type: array
items:
type: string
example:
- "code"
- "code id_token"
- "id_token"
uniqueItems: true
grant_types_supported:
type: array
items:
type: string
example:
- "authorization_code"
- "refresh_token"
default:
- "authorization_code"
- "implicit"
uniqueItems: true
subject_types_supported:
type: array
items:
type: string
example:
- "pairwise"
- "public"
uniqueItems: true
id_token_signing_alg_values_supported:
type: array
items:
type: string
example:
- "RS256"
uniqueItems: true
token_endpoint_auth_methods_supported:
type: array
items:
type: string
example:
- "client_secret_basic"
- "client_secret_post"
uniqueItems: true
claims_supported:
type: array
items:
type: string
example:
- "aud"
- "exp"
- "iat"
- "iss"
- "sub"
uniqueItems: true
Error:
type: object
required:
- error
- error_description
properties:
error:
type: string
example: ""
error_description:
type: string
example: ""
JWK:
type: object
required:
- kid
- kty
# - e
# - n
properties:
kid:
type: string
example: "9b43e575-a435-4868-9ca5-197255dc4ce3"
description: "Key ID"
kty:
type: string
example: "RSA"
description: "Key Type"
use:
type: string
example: "sig"
description: "Key Use"
e:
type: string
example: "AQAB"
description: ""
n:
type: string
example: ""
description: ""
JWEAlgorithm:
type: string
enum:
- RSA1_5
- RSA-OAEP
- RSA-OAEP-256
example: RSA-OAEP
JWEEncryption:
type: string
enum:
- A128GCM
- A192GCM
- A256GCM
- A128CBC-HS256
- A192CBC-HS384
- A256CBC-HS512
example: A128CBC-HS256
JWSAlgorithm:
type: string
enum:
- ES256
- ES384
- ES512
- PS256
- PS384
- PS512
- RS256
- RS384
- RS512
example: RS256
User:
type: object
required:
- sub
properties:
sub:
type: string
example: "248289761001"
description: ""
name:
type: string
example: "Jane Doe"
description: "The full name of the user"
given_name:
type: string
example: "Jane"
description: "The first name of the user"
family_name:
type: string
example: "doe"
description: "The last name of the user"
preferred_username:
type: string
example: "j.doe"
description: "The username for the user. Not always an email address."
email:
type: string
format: email
example: "janedoe@example.com"
description: "The email address of the user."
picture:
type: string
format: uri
example: "https://example.com/janedoe/me.jpg"
groups:
type: array
items:
type: string
example:
- "admin"
description: ""
uniqueItems: true
Token:
type: object
required:
- access_token
- expires_in
- id_token
- token_type
# - refresh_token
properties:
access_token:
type: string
format: password
description: |
A JSON Web Token (JWT) that represents the session that has just been created
for the user.
For example the body of the JWT contains:
```json
{
"jti": "",
"iss": "",
"iat": 0,
"exp": 0,
"aud": ""
}
```
expires_in:
type: integer
format: int32
example: 3600
default: 3600
description: "The number of seconds until the session expires. Defaults to 3600."
id_token:
type: string
format: password
description: "A JSON Web Token (JWT) containing user and scope information for this session."
token_type:
type: string
example: "Bearer"
description: 'The type of access token. Always set to "Bearer".'
refresh_token:
type: string
format: password
responses:
Default:
description: Unexpected Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
Token:
description: "OK"
content:
application/json:
schema:
$ref: "#/components/schemas/Token"
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
authentication_failed:
value:
error: "invalid_request"
error_description: "Authentication Failed"
unauthorized_access:
value:
error: "invalid_request"
error_description: "Access is unauthorized"