-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathlibregraph-connect-api-v1.yaml
More file actions
1137 lines (1084 loc) · 28.1 KB
/
libregraph-connect-api-v1.yaml
File metadata and controls
1137 lines (1084 loc) · 28.1 KB
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
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: '3.0.0'
info:
version: '1.0.0'
title: LibreGraph Connect API
description: |
LibreGraph Connect provides OpenID Connect Provider (OP) functionality with integrated web login and consent forms.
This API implements:
- OpenID Connect Core 1.0
- OpenID Connect Discovery 1.0
- OpenID Connect Session Management 1.0
- OAuth 2.0 Authorization Framework
- Dynamic Client Registration
- SAML2 integration
Base URLs:
- OIDC endpoints: `/konnect/v1/`
- Authentication UI: `/signin/v1/identifier/`
- Identifier app: `/identifier/`
contact:
name: LibreGraph Developers
url: https://github.com/libregraph/lico
license:
name: Apache License Version 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
servers:
- url: 'https://{hostname}{basePath}'
variables:
hostname:
default: localhost:8443
description: LibreGraph Connect server hostname and port
basePath:
default: ''
description: 'Configurable URI base path (e.g., /api/v1)'
tags:
- name: discovery
description: OpenID Connect Discovery endpoints
- name: oidc
description: OpenID Connect core endpoints
- name: identifier
description: Authentication and consent endpoints
- name: oauth2
description: OAuth2 flow endpoints
- name: saml2
description: SAML2 integration endpoints
- name: static
description: Static assets and UI endpoints
paths:
# OpenID Connect Discovery
/.well-known/openid-configuration:
get:
tags:
- discovery
summary: OpenID Connect Discovery Document
description: Returns the OpenID Connect provider metadata
operationId: getDiscovery
responses:
'200':
description: Provider metadata
content:
application/json:
schema:
$ref: '#/components/schemas/ProviderMetadata'
# OIDC Core Endpoints
/konnect/v1/jwks.json:
get:
tags:
- oidc
summary: JSON Web Key Set
description: Returns the provider's public keys for JWT verification
operationId: getJWKS
responses:
'200':
description: JSON Web Key Set
content:
application/json:
schema:
$ref: '#/components/schemas/JSONWebKeySet'
application/jwk-set+json:
schema:
$ref: '#/components/schemas/JSONWebKeySet'
/signin/v1/identifier/_/authorize:
get:
tags:
- oidc
summary: Authorization Endpoint
description: OpenID Connect authorization endpoint for authorization code, implicit, and hybrid flows
operationId: authorize
parameters:
- name: response_type
in: query
required: true
schema:
type: string
enum: [code, id_token, token, 'code id_token', 'code token', 'code id_token token', 'id_token token']
- name: client_id
in: query
required: true
schema:
type: string
- name: redirect_uri
in: query
required: true
schema:
type: string
format: uri
- name: scope
in: query
required: true
schema:
type: string
- name: state
in: query
schema:
type: string
- name: nonce
in: query
schema:
type: string
- name: prompt
in: query
schema:
type: string
enum: [none, login, consent, select_account]
- name: max_age
in: query
schema:
type: integer
- name: id_token_hint
in: query
schema:
type: string
- name: request
in: query
schema:
type: string
- name: code_challenge
in: query
schema:
type: string
- name: code_challenge_method
in: query
schema:
type: string
enum: [S256]
responses:
'302':
description: Redirect to client with authorization code or error
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/OIDCError'
post:
tags:
- oidc
summary: Authorization Endpoint (POST)
description: Authorization endpoint with form POST
operationId: authorizePost
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
response_type:
type: string
client_id:
type: string
redirect_uri:
type: string
scope:
type: string
state:
type: string
nonce:
type: string
responses:
'302':
description: Redirect to client with authorization code or error
'400':
description: Bad request
/konnect/v1/token:
post:
tags:
- oidc
summary: Token Endpoint
description: Token endpoint for authorization code and refresh token grants
operationId: token
security:
- clientBasicAuth: []
- clientFormAuth: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
oneOf:
- allOf:
- $ref: '#/components/schemas/AuthorizationCodeGrant'
- type: object
properties:
client_id:
type: string
client_secret:
type: string
- $ref: '#/components/schemas/RefreshTokenGrant'
responses:
'200':
description: Token response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/OIDCError'
/konnect/v1/userinfo:
get:
tags:
- oidc
summary: UserInfo Endpoint
description: Returns user information for the authenticated user
operationId: getUserInfo
security:
- bearerAuth: []
responses:
'200':
description: User information
content:
application/json:
schema:
$ref: '#/components/schemas/UserInfo'
'401':
description: Unauthorized
head:
tags:
- oidc
summary: UserInfo Endpoint (HEAD)
description: Returns user information headers without body
operationId: getUserInfoHead
security:
- bearerAuth: []
responses:
'200':
description: User information headers
headers:
Content-Type:
schema:
type: string
example: application/json
'401':
description: Unauthorized
post:
tags:
- oidc
summary: UserInfo Endpoint (POST)
description: Returns user information via POST request
operationId: getUserInfoPost
security:
- bearerAuth: []
responses:
'200':
description: User information
content:
application/json:
schema:
$ref: '#/components/schemas/UserInfo'
/signin/v1/identifier/_/endsession:
get:
tags:
- oidc
summary: End Session Endpoint
description: Terminates user session and performs single logout
operationId: endSession
parameters:
- name: id_token_hint
in: query
schema:
type: string
- name: post_logout_redirect_uri
in: query
schema:
type: string
format: uri
- name: state
in: query
schema:
type: string
responses:
'302':
description: Redirect after logout
'200':
description: Logout page
post:
tags:
- oidc
summary: End Session Endpoint (POST)
description: End session via POST
operationId: endSessionPost
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
id_token_hint:
type: string
post_logout_redirect_uri:
type: string
responses:
'302':
description: Redirect after logout
/konnect/v1/session/check-session.html:
get:
tags:
- oidc
summary: Session Check Iframe
description: Returns HTML iframe for OIDC Session Management
operationId: checkSessionIframe
responses:
'200':
description: Session check iframe HTML
content:
text/html:
schema:
type: string
/konnect/v1/register:
post:
tags:
- oidc
summary: Dynamic Client Registration
description: Dynamically register new OAuth2/OIDC clients
operationId: registerClient
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClientRegistrationRequest'
responses:
'201':
description: Client registered successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ClientRegistrationResponse'
'400':
description: Bad request
# Identifier Authentication Endpoints
/identifier/_/hello:
post:
tags:
- identifier
summary: Authentication Status Check
description: Checks current authentication status and returns user information if logged in
operationId: hello
security:
- cookieAuth: []
parameters:
- $ref: '#/components/parameters/XSRFHeader'
- $ref: '#/components/parameters/OriginHeader'
- $ref: '#/components/parameters/RefererHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HelloRequest'
responses:
'200':
description: Hello response with user info
content:
application/json:
schema:
$ref: '#/components/schemas/HelloResponse'
'204':
description: Not authenticated
headers:
Kopano-Konnect-State:
schema:
type: string
'400':
description: Bad request
/identifier/_/logon:
post:
tags:
- identifier
summary: User Authentication
description: Authenticates user with username and password
operationId: logon
parameters:
- $ref: '#/components/parameters/XSRFHeader'
- $ref: '#/components/parameters/OriginHeader'
- $ref: '#/components/parameters/RefererHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LogonRequest'
responses:
'200':
description: Authentication successful
content:
application/json:
schema:
$ref: '#/components/schemas/LogonResponse'
headers:
Set-Cookie:
schema:
type: string
example: lico-identifier-session=encrypted-data; Path=/; Secure; HttpOnly; SameSite=Strict
'204':
description: Authentication failed
headers:
Kopano-Konnect-State:
schema:
type: string
'400':
description: Bad request
/identifier/_/logoff:
post:
tags:
- identifier
summary: User Logout
description: Logs out current user and clears session
operationId: logoff
parameters:
- $ref: '#/components/parameters/XSRFHeader'
- $ref: '#/components/parameters/OriginHeader'
- $ref: '#/components/parameters/RefererHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/StateRequest'
responses:
'200':
description: Logout successful
content:
application/json:
schema:
$ref: '#/components/schemas/StateResponse'
'400':
description: Bad request
/identifier/_/consent:
post:
tags:
- identifier
summary: Consent Processing
description: Processes user consent decisions for OAuth2/OIDC flows
operationId: consent
security:
- cookieAuth: []
parameters:
- $ref: '#/components/parameters/XSRFHeader'
- $ref: '#/components/parameters/OriginHeader'
- $ref: '#/components/parameters/RefererHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ConsentRequest'
responses:
'200':
description: Consent processed
content:
application/json:
schema:
$ref: '#/components/schemas/StateResponse'
headers:
Set-Cookie:
schema:
type: string
description: Encrypted consent cookie
'204':
description: Consent rejected
'400':
description: Bad request
# OAuth2 Flow Endpoints
/identifier/oauth2/start:
get:
tags:
- oauth2
summary: OAuth2 Flow Initiation
description: Initiates OAuth2 authorization flow with external providers
operationId: oauth2Start
responses:
'302':
description: Redirect to external OAuth2 provider
/identifier/oauth2/cb:
get:
tags:
- oauth2
summary: OAuth2 Callback
description: Handles OAuth2 callback from external providers
operationId: oauth2Callback
responses:
'302':
description: Redirect after processing callback
# SAML2 Endpoints
/identifier/saml2/metadata:
get:
tags:
- saml2
summary: SAML2 Metadata
description: Returns SAML2 service provider metadata
operationId: saml2Metadata
responses:
'200':
description: SAML2 metadata
content:
application/xml:
schema:
type: string
/identifier/saml2/acs:
post:
tags:
- saml2
summary: SAML2 Assertion Consumer Service
description: Processes SAML2 assertions from identity providers
operationId: saml2ACS
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
SAMLResponse:
type: string
responses:
'302':
description: Redirect after processing assertion
/identifier/_/saml2/slo:
get:
tags:
- saml2
summary: SAML2 Single Logout
description: Handles SAML2 single logout requests
operationId: saml2SLO
responses:
'302':
description: Redirect after logout
# Trampolin
/identifier/trampolin:
get:
tags:
- identifier
summary: Secure Redirect
description: Secure redirect mechanism for external URLs
operationId: trampolin
responses:
'302':
description: Secure redirect
'200':
description: Trampolin page with JavaScript redirect
# Static and UI Endpoints
/identifier:
get:
tags:
- static
summary: Main Identifier Application
description: Serves the React-based identifier application
operationId: identifierApp
responses:
'200':
description: Identifier application HTML
/static/{path}:
get:
tags:
- static
summary: Static Assets
description: Serves static files (CSS, JS, images)
operationId: staticAssets
parameters:
- name: path
in: path
required: true
schema:
type: string
responses:
'200':
description: Static file content
'404':
description: File not found
components:
parameters:
XSRFHeader:
name: Kopano-Konnect-XSRF
in: header
required: true
schema:
type: integer
enum: [1]
description: CSRF protection header
OriginHeader:
name: Origin
in: header
schema:
type: string
format: uri
description: Request origin (required with XSRF header)
RefererHeader:
name: Referer
in: header
schema:
type: string
format: uri
description: Request referer (alternative to Origin)
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: __Secure-KKT
description: |
Encrypted session cookie. Cookie name may vary based on configuration.
Default pattern: __Secure-* for secure contexts, regular name otherwise.
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT access token
clientBasicAuth:
type: http
scheme: basic
description: Client credentials in Authorization header
clientFormAuth:
type: apiKey
in: query
name: client_id
description: Client credentials in request body
schemas:
# OIDC Discovery
ProviderMetadata:
type: object
required:
- issuer
- authorization_endpoint
- token_endpoint
- userinfo_endpoint
- jwks_uri
properties:
issuer:
type: string
format: uri
authorization_endpoint:
type: string
format: uri
token_endpoint:
type: string
format: uri
userinfo_endpoint:
type: string
format: uri
jwks_uri:
type: string
format: uri
end_session_endpoint:
type: string
format: uri
check_session_iframe:
type: string
format: uri
registration_endpoint:
type: string
format: uri
scopes_supported:
type: array
items:
type: string
response_types_supported:
type: array
items:
type: string
grant_types_supported:
type: array
items:
type: string
enum: [authorization_code, implicit, refresh_token]
subject_types_supported:
type: array
items:
type: string
id_token_signing_alg_values_supported:
type: array
items:
type: string
token_endpoint_auth_methods_supported:
type: array
items:
type: string
userinfo_signing_alg_values_supported:
type: array
items:
type: string
request_object_signing_alg_values_supported:
type: array
items:
type: string
token_endpoint_auth_signing_alg_values_supported:
type: array
items:
type: string
claims_parameter_supported:
type: boolean
claims_supported:
type: array
items:
type: string
request_parameter_supported:
type: boolean
request_uri_parameter_supported:
type: boolean
JSONWebKeySet:
type: object
required:
- keys
properties:
keys:
type: array
items:
$ref: '#/components/schemas/JSONWebKey'
JSONWebKey:
type: object
properties:
kty:
type: string
kid:
type: string
use:
type: string
alg:
type: string
n:
type: string
e:
type: string
# Token Endpoints
AuthorizationCodeGrant:
type: object
required:
- grant_type
- code
- redirect_uri
properties:
grant_type:
type: string
enum: [authorization_code]
code:
type: string
redirect_uri:
type: string
format: uri
client_id:
type: string
client_secret:
type: string
code_verifier:
type: string
RefreshTokenGrant:
type: object
required:
- grant_type
- refresh_token
properties:
grant_type:
type: string
enum: [refresh_token]
refresh_token:
type: string
scope:
type: string
TokenResponse:
type: object
required:
- access_token
- token_type
properties:
access_token:
type: string
token_type:
type: string
enum: [Bearer]
expires_in:
type: integer
refresh_token:
type: string
id_token:
type: string
scope:
type: string
UserInfo:
type: object
properties:
sub:
type: string
name:
type: string
given_name:
type: string
family_name:
type: string
preferred_username:
type: string
email:
type: string
format: email
email_verified:
type: boolean
picture:
type: string
format: uri
# Client Registration
ClientRegistrationRequest:
type: object
required:
- redirect_uris
properties:
redirect_uris:
type: array
items:
type: string
format: uri
response_types:
type: array
items:
type: string
grant_types:
type: array
items:
type: string
application_type:
type: string
enum: [web, native]
client_name:
type: string
client_uri:
type: string
format: uri
contacts:
type: array
items:
type: string
format: email
jwks:
type: object
post_logout_redirect_uris:
type: array
items:
type: string
format: uri
ClientRegistrationResponse:
allOf:
- $ref: '#/components/schemas/ClientRegistrationRequest'
- type: object
required:
- client_id
properties:
client_id:
type: string
client_secret:
type: string
client_id_issued_at:
type: integer
client_secret_expires_at:
type: integer
# Identifier Schemas
HelloRequest:
type: object
required:
- state
properties:
state:
type: string
flow:
type: string
scope:
type: string
prompt:
type: string
client_id:
type: string
redirect_uri:
type: string
format: uri
id_token_hint:
type: string
max_age:
type: string
HelloResponse:
type: object
required:
- state
- flow
- success
properties:
state:
type: string
flow:
type: string
success:
type: boolean
username:
type: string
displayName:
type: string
next:
type: string
continue_uri:
type: string
format: uri
description: URI to continue the authentication flow
scopes:
$ref: '#/components/schemas/ScopesMap'
client:
$ref: '#/components/schemas/ClientDetails'
meta:
$ref: '#/components/schemas/Meta'
branding:
$ref: '#/components/schemas/Branding'
LogonRequest:
type: object
required:
- state
- params
properties:
state:
type: string
params:
type: array
minItems: 1
maxItems: 3
items:
type: string
description: |
Logon parameters array with format: [username, password, mode]
- username (required): User identifier
- password: User password (can be empty for mode "0")
- mode: Authentication mode (required when array has 3 elements)
example: ["john.doe", "secret123", "1"]
hello:
$ref: '#/components/schemas/HelloRequest'
LogonResponse:
type: object
required:
- success
- state
properties:
success:
type: boolean
state:
type: string
hello: