-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
2481 lines (2477 loc) · 74.6 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: "1"
title: "django-allauth: Headless API"
description:
$ref: "./description.md"
contact:
email: [email protected]
license:
name: MIT
url: https://opensource.org/license/mit
externalDocs:
description: The django-allauth project.
url: http://allauth.org
tags:
- name: Configuration
description: |
Exposes information on the configuration of django-allauth.
- name: "Authentication: Account"
description: |
All functionality related towards authenticating regular
username/email-password based accounts.
- name: "Account: Email"
description: |
The API used for manipulating the email addresses attached to a given
account. This is intentionally modeled as one endpoint, representing the
collection of all the email addresses. Note that manipulating one email
address may affect another. For example, marking one email address as
primary implies the previous primary email address is changed as
well. Also, if django-allauth is configured with `ACCOUNT_CHANGE_EMAIL =
True`, verifying the email address the user is changing to will cause the
previous email addres to be removed.
- name: "Account: Password"
description: |
Endpoints that can be used to alter the password for a given account.
- name: "Account: Providers"
description: |
Management of third-party provider accounts that are connected to the
authenticated account.
- name: "Authentication: 2FA"
description: |
Endpoints related towards completing the Two-Factor Authentication stage
during the authentication cycle.
x-tagGroups:
- name: Overall
tags:
- "Configuration"
- name: Authentication
tags:
- "Authentication: Current Session"
- "Authentication: Account"
- "Authentication: Password Reset"
- "Authentication: Providers"
- "Authentication: 2FA"
- "Authentication: Login By Code"
- name: Account
tags:
- "Account: Email"
- "Account: Password"
- "Account: Providers"
- "Account: 2FA"
- name: Sessions
tags:
- "Sessions"
paths:
######################################################################
# Base
######################################################################
/_allauth/{client}/v1/config:
get:
summary: Get configuration
tags:
- Configuration
description: |
There are many configuration options that alter the functionality
and behavior of django-allauth, some of which can also impact the
frontend. Therefore, relevant configuration options are exposed via
this endpoint. The data returned is not user/authentication
dependent. Hence, it suffices to only fetch this data once at boot
time of your application.
parameters:
- $ref: "#/components/parameters/Client"
responses:
"200":
$ref: "#/components/responses/Configuration"
######################################################################
# Authentication: Account
######################################################################
/_allauth/{client}/v1/auth/login:
post:
tags:
- "Authentication: Account"
summary: Login
description: |
Login using a username-password or email-password combination.
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/Login"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPassword"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
password_mismatch:
$ref: "#/components/examples/PasswordMismatch"
"401":
description: |
Not authenticated.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
pending_email:
$ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
pending_2fa:
$ref: "#/components/examples/UnauthenticatedPending2FA"
/_allauth/{client}/v1/auth/signup:
post:
tags:
- "Authentication: Account"
summary: Signup
description: |
Whether or not `username`, `email`, or both are required depends on
the configuration of django-allauth. Additionally, if a custom signup
form is used there may be other custom properties required.
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/Signup"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPassword"
"400":
description: |
An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
"401":
description: |
Not authenticated.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
pending_email:
$ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
"403":
description: |
Forbidden. For example, when signup is closed.
content:
application/json:
schema:
$ref: "#/components/schemas/ForbiddenResponse"
/_allauth/{client}/v1/auth/email/verify:
get:
tags:
- "Authentication: Account"
summary: Get email verification information
description: |
Obtain email verification information, given the token that was sent to
the user by email.
parameters:
- $ref: "#/components/parameters/EmailVerificationKey"
- $ref: "#/components/parameters/Client"
responses:
"200":
$ref: "#/components/responses/EmailVerificationInfo"
"400":
description: |
An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmailVerificationKey"
post:
tags:
- "Authentication: Account"
summary: Verify an email
description: |
Complete the email verification process.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/VerifyEmail"
responses:
"200":
$ref: "#/components/responses/Authenticated"
"400":
description: |
An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmailVerificationKey"
"401":
$ref: "#/components/responses/Unauthenticated"
/_allauth/{client}/v1/auth/reauthenticate:
post:
tags:
- "Authentication: Account"
summary: Reauthenticate
description: |
In order to safeguard the account, some actions require the user to be
recently authenticated. If you try to perform such an action without
having been recently authenticated, a `401` status is returned, listing
flows that can be performed to reauthenticate. One such flow is the flow
with ID `reauthenticate`, which allows for the user to input the
password. This is the endpoint related towards that flow.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/Reauthenticate"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPassword"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/IncorrectPassword"
######################################################################
# Authentication: Password
######################################################################
/_allauth/{client}/v1/auth/password/request:
post:
summary: Request password
tags:
- "Authentication: Password Reset"
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/RequestPassword"
responses:
"200":
$ref: "#/components/responses/StatusOK"
"400":
description: |
An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
/_allauth/{client}/v1/auth/password/reset:
get:
summary: Get password reset information
tags:
- "Authentication: Password Reset"
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/PasswordResetKey"
responses:
"200":
$ref: "#/components/responses/PasswordResetInfo"
"400":
description: |
An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
password_reset_key_invalid:
$ref: "#/components/examples/InvalidPasswordResetKey"
post:
summary: Reset password
tags:
- "Authentication: Password Reset"
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/ResetPassword"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPassword"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
"401":
$ref: "#/components/responses/Authentication"
######################################################################
# Authentication: Providers
######################################################################
/_allauth/browser/v1/auth/provider/redirect:
post:
tags:
- "Authentication: Providers"
summary: Provider redirect
description: |
Initiates the third-party provider authentication redirect flow. As calling
this endpoint results in a user facing redirect (302), this call is only
available in a browser, and must be called in a synchronous (non-XHR)
manner.
requestBody:
$ref: "#/components/requestBodies/ProviderRedirect"
responses:
"302":
description: The provider authorization URL to which the client should be redirected.
headers:
location:
schema:
type: string
description: The redirect URL.
/_allauth/{client}/v1/auth/provider/token:
post:
tags:
- "Authentication: Providers"
summary: Provider token
description: |
Authenticates with a third-party provider using provider tokens received
by other means. For example, in case of a mobile app, the authentication
flow runs completely on the device itself, without any interaction with
the API. Then, when the (device) authentication completes and the mobile
app receives an access and/or ID token, it can hand over these tokens
via this endpoint to authenticate on the server.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/ProviderToken"
responses:
"200":
$ref: "#/components/responses/Authenticated"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_token:
$ref: "#/components/examples/InvalidProviderToken"
"401":
description: Not authenticated, more steps are required to be completed.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
unauthenticated_pending_2fa:
$ref: "#/components/examples/UnauthenticatedPending2FA"
unauthenticated_pending_email_verification:
$ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
"403":
description: |
Forbidden. For example, when signup is closed.
content:
application/json:
schema:
$ref: "#/components/schemas/ForbiddenResponse"
/_allauth/{client}/v1/auth/provider/signup:
post:
tags:
- "Authentication: Providers"
summary: Provider signup
description: |
If, while signing up using a third-party provider account, there is
insufficient information received from the provider to automatically
complete the signup process, an additional step is needed to complete
the missing data before the user is fully signed up and authenticated.
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/ProviderSignup"
responses:
"200":
$ref: "#/components/responses/Authenticated"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
"401":
description: Not authenticated, more steps are required to be completed.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
unauthenticated_pending_email_verification:
$ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
"403":
description: |
Forbidden. For example, when signup is closed.
content:
application/json:
schema:
$ref: "#/components/schemas/ForbiddenResponse"
"409":
description: |
Conflict. The provider signup flow is not pending.
content:
application/json:
schema:
$ref: "#/components/schemas/ConflictResponse"
######################################################################
# Authentication: 2FA
######################################################################
/_allauth/{client}/v1/auth/2fa/authenticate:
post:
tags:
- "Authentication: 2FA"
summary: Two-factor authentication
description: |
If, during authentication, a response with status 401 is encountered where one of the pending
flows has ID `mfa_authenticate`, that indicates that the Two-Factor Authentication stage needs to
be completed.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/MFAAuthenticate"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPasswordAnd2FA"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidAuthenticatorCode"
"401":
$ref: "#/components/responses/Authentication"
/_allauth/{client}/v1/auth/2fa/reauthenticate:
post:
tags:
- "Authentication: 2FA"
summary: Reauthenticate using 2FA
description: |
In order to safeguard the account, some actions require the user to be
recently authenticated. If you try to perform such an action without
having been recently authenticated, a `401` status is returned, listing
flows that can be performed to reauthenticate. One such flow is the flow
with ID `mfa_reauthenticate`, which allows for the user to input an
authenticator code (e.g. TOTP or recovery code). This is the endpoint
related towards that flow.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByPasswordAnd2FA"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidAuthenticatorCode"
######################################################################
# Authentication: Login by Code
######################################################################
/_allauth/{client}/v1/auth/code/request:
post:
tags:
- "Authentication: Login By Code"
summary: Request login code
description: |
Request a "special" login code that is sent to the user by email.
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/RequestLoginCode"
responses:
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_email:
$ref: "#/components/examples/InvalidEmail"
"401":
description: |
Not authenticated.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
pending_login_by_code:
$ref: "#/components/examples/UnauthenticatedPendingLoginByCode"
/_allauth/{client}/v1/auth/code/confirm:
post:
tags:
- "Authentication: Login By Code"
summary: Confirm login code
description: |
Use this endpoint to input along the received "special" login code.
parameters:
- $ref: "#/components/parameters/Client"
requestBody:
$ref: "#/components/requestBodies/ConfirmLoginCode"
responses:
"200":
$ref: "#/components/responses/AuthenticatedByCode"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidAuthenticatorCode"
"401":
description: |
Not authenticated.
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationResponse"
examples:
unauthenticated_pending_2fa:
$ref: "#/components/examples/UnauthenticatedPending2FA"
######################################################################
# Account: Providers
######################################################################
/_allauth/{client}/v1/account/providers:
get:
tags:
- "Account: Providers"
summary: List the connected third-party provider accounts
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/ProviderAccounts"
delete:
tags:
- "Account: Providers"
summary: |
Disconnect a third-party provider account
description: |
Disconnect a third-party provider account, returning the remaining
accounts that are still connected. The disconnect is not allowed if it
would leave the account unusable. For example, if no password was
set up yet.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/ProviderAccount"
responses:
"200":
$ref: "#/components/responses/ProviderAccounts"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
no_password:
$ref: "#/components/examples/DisconnectNotAllowedNoPassword"
no_email:
$ref: "#/components/examples/DisconnectNotAllowedNoVerifiedEmail"
######################################################################
# Account: Email
######################################################################
/_allauth/{client}/v1/account/email:
get:
tags:
- "Account: Email"
summary: List email addresses
description: |
Retrieves the list of email addreses of the account.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/EmailAddresses"
"401":
$ref: "#/components/responses/Authentication"
post:
tags:
- "Account: Email"
summary: |
Add an email addresses
description: |
Add a new email address to the account. The email address will be marked as unverified, and
an email verification mail will be sent.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/Email"
responses:
"200":
$ref: "#/components/responses/EmailAddresses"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidEmail"
"401":
$ref: "#/components/responses/AuthenticationOrReauthentication"
put:
tags:
- "Account: Email"
summary: Request email verification
description: |
Requests for (another) email verification email to be sent. Note that
sending emails is rate limited, so when you send too many requests the
email will not be sent.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/Email"
responses:
"200":
$ref: "#/components/responses/StatusOK"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidEmail"
"403":
description: |
Too many email verification mails were already sent.
content:
application/json:
schema:
$ref: "#/components/schemas/ForbiddenResponse"
patch:
tags:
- "Account: Email"
summary: Change primary email address
description: |
Used to change primary email address to a different one. Note that only verified email addresses
can be marked as primary.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/MarkPrimaryEmail"
responses:
"200":
$ref: "#/components/responses/EmailAddresses"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidEmail"
delete:
tags:
- "Account: Email"
summary: Remove an email address
description: |
Used to remove an email address.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/Email"
responses:
"200":
$ref: "#/components/responses/EmailAddresses"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidEmail"
######################################################################
# Account: 2FA
######################################################################
/_allauth/{client}/v1/account/authenticators:
get:
tags:
- "Account: 2FA"
summary: List authenticators
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/Authenticators"
"401":
$ref: "#/components/responses/Authentication"
"410":
$ref: "#/components/responses/SessionGone"
/_allauth/{client}/v1/account/authenticators/totp:
get:
tags:
- "Account: 2FA"
summary: TOTP authenticator status
description: |
Retrieve the information about the current TOTP authenticator, if any.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"404":
$ref: "#/components/responses/TOTPAuthenticatorNotFound"
"200":
$ref: "#/components/responses/TOTPAuthenticator"
post:
tags:
- "Account: 2FA"
summary: Activate TOTP
description: |
The code should be provided from the consuming TOTP authenticator
application which was generated using the TOTP authenticator secret
retrieved from the TOTP authenticator status endpoint.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/SetupTOTP"
responses:
"200":
$ref: "#/components/responses/TOTPAuthenticator"
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/InvalidAuthenticatorCode"
delete:
tags:
- "Account: 2FA"
summary: Deactivate TOTP
description: |
Deactivates TOTP authentication. If the user authentication is not
sufficiently recent, a reauthentication flow (`401`) will is presented.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/StatusOK"
"401":
$ref: "#/components/responses/ReauthenticationRequired"
/_allauth/{client}/v1/account/authenticators/recovery_codes:
get:
tags:
- "Account: 2FA"
summary: List recovery codes
description: |
List recovery codes.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/RecoveryCodes"
"401":
$ref: "#/components/responses/ReauthenticationRequired"
"404":
$ref: "#/components/responses/NotFound"
post:
tags:
- "Account: 2FA"
summary: Regenerate recovery codes
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"400":
description: An input error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_code:
$ref: "#/components/examples/CannotGenerateRecoveryCodes"
"401":
$ref: "#/components/responses/ReauthenticationRequired"
######################################################################
# Sessions
######################################################################
/_allauth/{client}/v1/auth/session:
get:
tags:
- "Authentication: Current Session"
summary: |
Get authentication status
description: |
Retrieve information about the authentication status for the current
session.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"200":
$ref: "#/components/responses/Authenticated"
"401":
$ref: "#/components/responses/Authentication"
"410":
$ref: "#/components/responses/SessionGone"
delete:
tags:
- "Authentication: Current Session"
summary: Logout
description: |
Logs out the user from the current session.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
responses:
"401":
$ref: "#/components/responses/Unauthenticated"
######################################################################
# Account: Password
######################################################################
/_allauth/{client}/v1/account/password/change:
post:
tags:
- "Account: Password"
summary: Change password
description: |
In order to change the password of an account, the current and new
password must be provider. However, accounts that were created by
signing up using a third-party provider do not have a password set. In
that case, the current password is not required.
parameters:
- $ref: "#/components/parameters/Client"
- $ref: "#/components/parameters/SessionToken"
requestBody:
$ref: "#/components/requestBodies/ChangePassword"
responses:
"400":
$ref: "#/components/responses/Error"
"401":
$ref: "#/components/responses/Authentication"
######################################################################
# Authentication: Current Sessions
######################################################################
/_allauth/{client}/v1/sessions:
get:
tags:
- "Sessions"
summary: List sessions
parameters:
- $ref: "#/components/parameters/Client"
responses:
"200":
$ref: "#/components/responses/Sessions"
delete:
tags:
- "Sessions"
summary: Delete a session
parameters:
- $ref: "#/components/parameters/Client"
responses:
"200":
$ref: "#/components/responses/Sessions"
components:
######################################################################
# Components: Examples
######################################################################
examples:
AuthenticatedByPassword:
summary: |
Authenticated by password.
value:
status: 200
data:
user:
id: 123
display: wizard
has_usable_password: true
email: [email protected]
username: wizard
methods:
- method: password
at: 1711555057.065702
email: [email protected]
meta:
is_authenticated: true
session_token: ufwcig0zen9skyd545jc0fkq813ghar2
access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
AuthenticatedByCode:
summary: |
Authenticated by code.
value:
status: 200
data:
user:
id: 123
display: wizard
has_usable_password: true
email: [email protected]
username: wizard
methods:
- method: code
at: 1711555057.065702
email: [email protected]
meta:
is_authenticated: true
session_token: ufwcig0zen9skyd545jc0fkq813ghar2
access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
AuthenticatedByPasswordAnd2FA:
summary: |
Fully authenticated using by password and 2FA.
value:
status: 200
data:
user:
id: 123
display: Magic Wizard
has_usable_password: true
email: [email protected]
username: wizard
methods:
- method: password
at: 1711555057.065702
email: [email protected]
- method: mfa
at: 1711555060.9375854
id: 66
type: totp
meta:
is_authenticated: true
session_token: ufwcig0zen9skyd545jc0fkq813ghar2
access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
CannotGenerateRecoveryCodes:
summary: |
Unable to generate recovery codes.
value:
status: 400
errors:
- message: |
You cannot deactivate two-factor authentication.
code: cannot_generate_recovery_codes
DisconnectNotAllowedNoPassword:
summary: Account without a password.
value:
status: 400