forked from supabase/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
2041 lines (1987 loc) · 66.1 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
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.3
info:
version: latest
title: GoTrue REST API (Supabase Auth)
description: |-
GoTrue is the software behind [Supabase Auth](https://supabase.com/auth). This is its REST API.
**Notes:**
- HTTP 5XX errors are not listed for each endpoint.
These should be handled globally. Not all HTTP 5XX errors are generated from GoTrue, and they may serve non-JSON content. Make sure you inspect the `Content-Type` header before parsing as JSON.
- Error responses are somewhat inconsistent.
Avoid using the `msg` and HTTP status code to identify errors. HTTP 400 and 422 are used interchangeably in many APIs.
- If the server has CAPTCHA protection enabled, the verification token should be included in the request body.
- Rate limit errors are consistently raised with the HTTP 429 code.
- Enums are used only in request bodies / parameters and not in responses to ensure wide compatibility with code generators that fail to include an unknown enum case.
**Backward compatibility:**
- Endpoints marked as _Experimental_ may change without notice.
- Endpoints marked as _Deprecated_ will be supported for at least 3 months since being marked as deprecated.
- HTTP status codes like 400, 404, 422 may change for the same underlying error condition.
termsOfService: https://supabase.com/terms
contact:
name: Ask a question about this API
url: https://github.com/supabase/supabase/discussions
license:
name: MIT License
url: https://github.com/supabase/gotrue/blob/master/LICENSE
externalDocs:
description: Learn more about Supabase Auth
url: https://supabase.com/docs/guides/auth/overview
servers:
- url: "https://{project}.supabase.co/auth/v1"
variables:
project:
description: >
Your Supabase project ID.
default: abcdefghijklmnopqrst
tags:
- name: auth
description: APIs for authentication and authorization.
- name: user
description: APIs used by a user to manage their account.
- name: oauth
description: APIs for dealing with OAuth flows.
- name: oidc
description: APIs for dealing with OIDC authentication flows. (Experimental.)
- name: sso
description: APIs for authenticating using SSO providers (SAML). (Experimental.)
- name: saml
description: SAML 2.0 Endpoints. (Experimental.)
- name: admin
description: Administration APIs requiring elevated access.
- name: general
description: General APIs.
paths:
/token:
post:
summary: Issues access and refresh tokens based on grant type.
tags:
- auth
- oidc
parameters:
- name: grant_type
in: query
required: true
description: >
What grant type should be used to issue an access and refresh token. Note that `id_token` is only offered in experimental mode. CAPTCHA protection is not effective on the `refresh_token` grant flow.
schema:
type: string
enum:
- password
- refresh_token
- id_token
- pkce
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
examples:
grant_type=password:
value:
email: [email protected]
password: password1
grant_type=refresh_token:
value:
refresh_token: 4nYUCw0wZR_DNOTSDbSGMQ
grant_type=pkce:
value:
auth_code: 009e5066-fc11-4eca-8c8c-6fd82aa263f2
code_verifier: ktPNXpR65N6JtgzQA8_5HHtH6PBSAahMNoLKRzQEa0Tzgl.vdV~b6lPk004XOd.4lR0inCde.NoQx5K63xPfzL8o7tJAjXncnhw5Niv9ycQ.QRV9JG.y3VapqbgLfIrJ
schema:
type: object
description: |-
For the refresh token flow, supply only `refresh_token`.
For the email/phone with password flow, supply `email`, `phone` and `password` with an optional `gotrue_meta_security`.
For the OIDC ID token flow, supply `id_token`, `nonce`, `provider`, `client_id`, `issuer` with an optional `gotrue_meta_security`.
properties:
refresh_token:
type: string
password:
type: string
email:
type: string
format: email
phone:
type: string
format: phone
id_token:
type: string
access_token:
type: string
description: Provide only when `grant_type` is `id_token` and the provided ID token requires the presence of an access token to be accepted (usually by having an `at_hash` claim).
nonce:
type: string
provider:
type: string
enum:
- google
- apple
- azure
- facebook
- keycloak
client_id:
type: string
issuer:
type: string
description: If `provider` is `azure` then you can specify any Azure OIDC issuer string here, which will be used for verification.
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
auth_code:
type: string
format: uuid
code_verifier:
type: string
responses:
200:
description: >
An access and refresh token have been successfully issued.
content:
application/json:
schema:
$ref: "#/components/schemas/AccessTokenResponseSchema"
400:
$ref: "#/components/responses/BadRequestResponse"
401:
$ref: "#/components/responses/ForbiddenResponse"
403:
$ref: "#/components/responses/UnauthorizedResponse"
500:
$ref: "#/components/responses/InternalServerErrorResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/logout:
post:
summary: Logs out a user.
tags:
- auth
security:
- APIKeyAuth: []
UserAuth: []
parameters:
- name: scope
in: query
description: >
(Optional.) Determines how the user should be logged out. When `global` is used, the user is logged out from all active sessions. When `local` is used, the user is logged out from the current session. When `others` is used, the user is logged out from all other sessions except the current one. Clients should remove stored access and refresh tokens except when `others` is used.
schema:
type: string
enum:
- global
- local
- others
responses:
204:
description: No content returned on successful logout.
401:
$ref: "#/components/responses/UnauthorizedResponse"
/verify:
get:
summary: Authenticate by verifying the posession of a one-time token. Usually for use as clickable links.
tags:
- auth
parameters:
- name: token
in: query
required: true
schema:
type: string
- name: type
in: query
required: true
schema:
type: string
enum:
- signup
- invite
- recovery
- magiclink
- email_change
- name: redirect_to
in: query
description: >
(Optional) URL to redirect back into the app on after verification completes successfully. If not specified will use the "Site URL" configuration option. If not allowed per the allow list it will use the "Site URL" configuration option.
schema:
type: string
format: uri
security:
- APIKeyAuth: []
responses:
302:
$ref: "#/components/responses/AccessRefreshTokenRedirectResponse"
post:
summary: Authenticate by verifying the posession of a one-time token.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
enum:
- signup
- recovery
- invite
- magiclink
- email_change
- sms
- phone_change
token:
type: string
token_hash:
type: string
description: >
The hashed value of token. Applicable only if used with `type` and nothing else.
email:
type: string
format: email
description: >
Applicable only if `type` is with regards to an email address.
phone:
type: string
format: phone
description: >
Applicable only if `type` is with regards to an phone number.
redirect_to:
type: string
format: uri
description: >
(Optional) URL to redirect back into the app on after verification completes successfully. If not specified will use the "Site URL" configuration option. If not allowed per the allow list it will use the "Site URL" configuration option.
responses:
200:
description: An access and refresh token.
content:
application/json:
schema:
$ref: "#/components/schemas/AccessTokenResponseSchema"
429:
$ref: "#/components/responses/RateLimitResponse"
/authorize:
get:
summary: Redirects to an external OAuth provider. Usually for use as clickable links.
tags:
- oauth
security:
- APIKeyAuth: []
parameters:
- name: provider
in: query
description: Name of the OAuth provider.
example: google
required: true
schema:
type: string
pattern: "[^a-zA-Z0-9]+"
- name: scopes
in: query
required: true
description: Space separated list of OAuth scopes to pass on to `provider`.
schema:
type: string
pattern: "[^ ]+( +[^ ]+)*"
- name: invite_token
in: query
description: (Optional) A token representing a previous invitation of the user. A successful sign-in with OAuth will mark the invitation as completed.
schema:
type: string
- name: redirect_to
in: query
description: >
(Optional) URL to redirect back into the app on after OAuth sign-in completes successfully or not. If not specified will use the "Site URL" configuration option. If not allowed per the allow list it will use the "Site URL" configuration option.
schema:
type: string
format: uri
- name: code_challenge_method
in: query
description: (Optional) Method used to encrypt the verifier. Can be `plain` (no transformation) or `s256` (where SHA-256 is used). It is always recommended that `s256` is used.
schema:
type: string
enum:
- plain
- s256
responses:
302:
$ref: "#/components/responses/OAuthAuthorizeRedirectResponse"
/signup:
post:
summary: Signs a user up.
description: >
Creates a new user.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
examples:
"email+password":
value:
email: [email protected]
password: password1
"phone+password":
value:
phone: "+1234567890"
password: password1
"phone+password+whatsapp":
value:
phone: "+1234567890"
password: password1
channel: whatsapp
"email+password+pkce":
value:
email: [email protected]
password: password1
code_challenge_method: s256
code_challenge: elU6u5zyqQT2f92GRQUq6PautAeNDf4DQPayyR0ek_c&
schema:
type: object
properties:
email:
type: string
format: email
phone:
type: string
format: phone
channel:
type: string
enum:
- sms
- whatsapp
password:
type: string
data:
type: object
code_challenge:
type: string
code_challenge_method:
type: string
enum:
- plain
- s256
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: >
A user already exists and is not confirmed (in which case a user object is returned). A user did not exist and is signed up. If email or phone confirmation is enabled, returns a user object. If confirmation is disabled, returns an access token and refresh token response.
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/AccessTokenResponseSchema"
- $ref: "#/components/schemas/UserSchema"
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/recover:
post:
summary: Request password recovery.
description: >
Users that have forgotten their password can have it reset with this API.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
format: email
code_challenge:
type: string
code_challenge_method:
type: string
enum:
- plain
- s256
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: A recovery email has been sent to the address. An empty JSON object is returned. To obfuscate whether such an email address already exists in the system this response is sent regardless whether the address exists or not.
content:
application/json:
schema:
type: object
400:
$ref: "#/components/responses/BadRequestResponse"
422:
description: Returned when unable to validate the email address.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorSchema"
429:
$ref: "#/components/responses/RateLimitResponse"
/resend:
post:
summary: Resends a one-time password (OTP) through email or SMS.
description: >
Allows a user to resend an existing signup, sms, email_change or phone_change OTP.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
description: >
Applicable only if `type` is with regards to an email address.
phone:
type: string
format: phone
description: >
Applicable only if `type` is with regards to an phone number.
type:
type: string
enum:
- signup
- email_change
- sms
- phone_change
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: A One-Time Password was sent to the email or phone. To obfuscate whether such an address or number already exists in the system this response is sent in both cases.
content:
application/json:
schema:
type: object
properties:
message_id:
type: string
description: Unique ID of the message as reported by the SMS sending provider. Useful for tracking deliverability problems.
400:
$ref: "#/components/responses/BadRequestResponse"
422:
description: Returned when unable to validate the email address or phone number.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorSchema"
429:
$ref: "#/components/responses/RateLimitResponse"
/magiclink:
post:
summary: Authenticate a user by sending them a magic link.
description: >
A magic link is a special type of URL that includes a One-Time Password. When a user visits this link in a browser they are immediately authenticated.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
format: email
data:
type: object
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: A recovery email has been sent to the address. An empty JSON object is returned. To obfuscate whether such an email address already exists in the system this response is sent regardless whether the address exists or not.
content:
application/json:
schema:
type: object
400:
$ref: "#/components/responses/BadRequestResponse"
422:
description: Returned when unable to validate the email address.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorSchema"
429:
$ref: "#/components/responses/RateLimitResponse"
/otp:
post:
summary: Authenticate a user by sending them a One-Time Password over email or SMS.
tags:
- auth
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
phone:
type: string
format: phone
channel:
type: string
enum:
- sms
- whatsapp
create_user:
type: boolean
data:
type: object
code_challenge_method:
type: string
enum:
- s256
- plain
code_challenge:
type: string
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: A One-Time Password was sent to the email or phone. To obfuscate whether such an address or number already exists in the system this response is sent in both cases.
content:
application/json:
schema:
type: object
properties:
message_id:
type: string
description: Unique ID of the message as reported by the SMS sending provider. Useful for tracking deliverability problems.
400:
$ref: "#/components/responses/BadRequestResponse"
422:
description: Returned when unable to validate the email or phone number.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorSchema"
429:
$ref: "#/components/responses/RateLimitResponse"
/user:
get:
summary: Fetch the latest user account information.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
responses:
200:
description: User's account information.
content:
application/json:
schema:
$ref: "#/components/schemas/UserSchema"
put:
summary: Update certain properties of the current user account.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
phone:
type: string
format: phone
password:
type: string
nonce:
type: string
data:
type: object
app_metadata:
type: object
channel:
type: string
enum:
- sms
- whatsapp
responses:
200:
description: User's updated account information.
content:
application/json:
schema:
$ref: "#/components/schemas/UserSchema"
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/reauthenticate:
post:
summary: Reauthenticates the possession of an email or phone number for the purpose of password change.
description: >
For a password to be changed on a user account, the user's email or phone number needs to be confirmed before they are allowed to set a new password. This requirement is configurable. This API sends a confirmation email or SMS message. A nonce in this message can be provided in `PUT /user` to change the password on the account.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
responses:
200:
description: A One-Time Password was sent to the user's email or phone.
content:
application/json:
schema:
type: object
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/factors:
post:
summary: Begin enrolling a new factor for MFA.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
requestBody:
content:
application/json:
schema:
type: object
required:
- factor_type
properties:
factor_type:
type: string
enum:
- totp
friendly_name:
type: string
issuer:
type: string
format: uri
responses:
200:
description: >
A new factor was created in the unverified state. Call `POST /factors/{factorId}/verify' to verify it.
content:
application/json:
schema:
type: object
properties:
id:
type: string
type:
type: string
enum:
- totp
totp:
type: object
properties:
qr_code:
type: string
secret:
type: string
uri:
type: string
400:
$ref: "#/components/responses/BadRequestResponse"
/factors/{factorId}/challenge:
post:
summary: Create a new challenge for a MFA factor.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
parameters:
- name: factorId
in: path
required: true
example: 2b306a77-21dc-4110-ba71-537cb56b9e98
schema:
type: string
format: uuid
responses:
200:
description: >
A new challenge was generated for the factor. Use `POST /factors/{factorId}/verify` to verify the challenge.
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
example: 14c1560e-2749-4522-bb62-d1458451830a
description: ID of the challenge.
expires_at:
type: integer
example: 1674840917
description: UNIX seconds of the timestamp past which the challenge should not be verified.
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/factors/{factorId}/verify:
post:
summary: Verify a challenge on a factor.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
parameters:
- name: factorId
in: path
required: true
example: 2b306a77-21dc-4110-ba71-537cb56b9e98
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
type: object
required:
- challenge_id
properties:
challenge_id:
type: string
format: uuid
code:
type: string
responses:
200:
description: >
This challenge has been verified. Client libraries should replace their stored access and refresh tokens with the ones provided in this response. These new credentials have an increased Authenticator Assurance Level (AAL).
content:
application/json:
schema:
$ref: "#/components/schemas/AccessTokenResponseSchema"
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"
/factors/{factorId}:
delete:
summary: Remove a MFA factor from a user.
tags:
- user
security:
- APIKeyAuth: []
UserAuth: []
parameters:
- name: factorId
in: path
required: true
example: 2b306a77-21dc-4110-ba71-537cb56b9e98
schema:
type: string
format: uuid
responses:
200:
description: >
This MFA factor is removed (unenrolled) and cannot be used for increasing the AAL level of user's sessions. Client libraries should use the `POST /token?grant_type=refresh_token` endpoint to get a new access and refresh token with a decreased AAL.
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
example: 2b306a77-21dc-4110-ba71-537cb56b9e98
400:
$ref: "#/components/responses/BadRequestResponse"
/callback:
get:
summary: Redirects OAuth flow errors to the frontend app.
description: >
When an OAuth sign-in flow fails for any reason, the error message needs to be delivered to the frontend app requesting the flow. This callback delivers the errors as `error` and `error_description` query params. Usually this request is not called directly.
tags:
- oauth
security:
- APIKeyAuth: []
responses:
302:
$ref: "#/components/responses/OAuthCallbackRedirectResponse"
post:
summary: Redirects OAuth flow errors to the frontend app.
description: >
When an OAuth sign-in flow fails for any reason, the error message needs to be delivered to the frontend app requesting the flow. This callback delivers the errors as `error` and `error_description` query params. Usually this request is not called directly.
tags:
- oauth
responses:
302:
$ref: "#/components/responses/OAuthCallbackRedirectResponse"
/sso:
post:
summary: Initiate a Single-Sign On flow.
tags:
- sso
security:
- APIKeyAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
domain:
type: string
format: hostname
description: Email address domain used to identify the SSO provider.
provider_id:
type: string
format: uuid
example: 40451fc2-4997-429c-bf7f-cc6f33c788e6
redirect_to:
type: string
format: uri
skip_http_redirect:
type: boolean
description: Set to `true` if the response to this request should not be a HTTP 303 redirect -- useful for browser-based applications.
code_challenge:
type: string
code_challenge_method:
type: string
enum:
- plain
- s256
gotrue_meta_security:
$ref: "#/components/schemas/GoTrueMetaSecurity"
responses:
200:
description: >
Returned only when `skip_http_redirect` is `true` and the SSO provider could be identified from the `provider_id` or `domain`. Client libraries should use the returned URL to redirect or open a browser.
content:
application/json:
schema:
type: object
properties:
url:
type: string
format: uri
303:
description: >
Returned only when `skip_http_redirect` is `false` or not present and the SSO provider could be identified from the `provider_id` or `domain`. Client libraries should follow the redirect. 303 is used instead of 302 because the request should be executed with a `GET` verb.
headers:
Location:
schema:
type: string
format: uri
400:
$ref: "#/components/responses/BadRequestResponse"
404:
description: >
Returned when the SSO provider could not be identified.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorSchema"
/saml/metadata:
get:
summary: Returns the SAML 2.0 Metadata XML.
description: >
The metadata XML can be downloaded or used for the SAML 2.0 Metadata URL discovery mechanism. This URL is the SAML 2.0 EntityID of the Service Provider implemented by this server.
tags:
- saml
security: []
parameters:
- name: download
in: query
description: >
If set to `true` will add a `Content-Disposition` header to the response which will trigger a download dialog on the browser.
schema:
type: boolean
responses:
200:
description: >
A valid SAML 2.0 Metadata XML document. Should be cached according to the `Cache-Control` header and/or caching data specified in the document itself.
headers:
Content-Disposition:
description: >
Present if `download=true`, which triggers the browser to show a donwload dialog.
schema:
type: string
example: attachment; filename="metadata.xml"
Cache-Control:
description: >
Should be parsed and obeyed to avoid putting strain on the server.
schema:
type: string
example: public, max-age=600
/saml/acs:
post:
summary: SAML 2.0 Assertion Consumer Service (ACS) endpoint.
description: >
Implements the SAML 2.0 Assertion Consumer Service (ACS) endpoint supporting the POST and Artifact bindings.
tags:
- saml
security: []
parameters:
- name: RelayState
in: query
schema:
oneOf:
- type: string
format: uri
description: URL to take the user to after the ACS has been verified. Often sent by Identity Provider initiated login requests.
- type: string
format: uuid
description: UUID of the SAML Relay State stored in the database, used to identify the Service Provider initiated login request.
- name: SAMLArt
in: query
description: >
See the SAML 2.0 ACS specification. Cannot be used without a UUID `RelayState` parameter.
schema:
type: string
- name: SAMLResponse
in: query
description: >
See the SAML 2.0 ACS specification. Must be present unless `SAMLArt` is specified. If `RelayState` is not a UUID, the SAML Response is unpacked and the identity provider is identified from the response.
schema:
type: string
responses:
302:
$ref: "#/components/responses/AccessRefreshTokenRedirectResponse"
400:
$ref: "#/components/responses/BadRequestResponse"
429:
$ref: "#/components/responses/RateLimitResponse"