|
1
|
get: |
|
2
|
operationId: GetMfaFactors |
|
3
|
summary: List Multifactor Authentication (MFA) Factors |
|
4
|
x-sidebar-summary: List MFA Factors |
|
5
|
description: > |
|
6
|
Retrieve the list of multi-factor authentication (MFA) factors registered |
|
7
|
for the authenticated user, |
|
8
|
|
|
9
|
including both pending (not yet verified) and enabled factors. |
|
10
|
x-authenticated: true |
|
11
|
parameters: [] |
|
12
|
x-codeSamples: |
|
13
|
- lang: JavaScript |
|
14
|
label: JS SDK |
|
15
|
source: |
|
16
|
$ref: ../code_samples/JavaScript/auth_mfa_factors/get.js |
|
17
|
- lang: Shell |
|
18
|
label: cURL |
|
19
|
source: |
|
20
|
$ref: ../code_samples/Shell/auth_mfa_factors/get.sh |
|
21
|
tags: |
|
22
|
- Multi-Factor Authentication |
|
23
|
responses: |
|
24
|
'200': |
|
25
|
description: OK |
|
26
|
'400': |
|
27
|
$ref: ../components/responses/400_error.yaml |
|
28
|
'401': |
|
29
|
$ref: ../components/responses/unauthorized.yaml |
|
30
|
'404': |
|
31
|
$ref: ../components/responses/not_found_error.yaml |
|
32
|
'409': |
|
33
|
$ref: ../components/responses/invalid_state_error.yaml |
|
34
|
'422': |
|
35
|
$ref: ../components/responses/invalid_request_error.yaml |
|
36
|
'500': |
|
37
|
$ref: ../components/responses/500_error.yaml |
|
38
|
x-since: 2.15.3 |
|
39
|
post: |
|
40
|
operationId: PostMfaFactors |
|
41
|
summary: Start Multi-Factor Authentication (MFA) Factor Enrollment |
|
42
|
x-sidebar-summary: Start MFA Factor Enrollment |
|
43
|
description: > |
|
44
|
Start the enrollment of a new multi-factor authentication (MFA) factor for |
|
45
|
the authenticated |
|
46
|
|
|
47
|
user. The response contains the factor along with provider-specific setup |
|
48
|
data (such as a |
|
49
|
|
|
50
|
secret and an `otpauth_url` for TOTP) that can be used to display a QR code. |
|
51
|
The factor must |
|
52
|
|
|
53
|
then be verified via the verify endpoint before it can be used. |
|
54
|
x-authenticated: true |
|
55
|
externalDocs: |
|
56
|
description: Learn more about MFA in Medusa |
|
57
|
url: https://docs.medusajs.com/resources/commerce-modules/auth/mfa |
|
58
|
parameters: [] |
|
59
|
requestBody: |
|
60
|
content: |
|
61
|
application/json: |
|
62
|
schema: |
|
63
|
type: object |
|
64
|
description: The details of the MFA factor to enroll. |
|
65
|
required: |
|
66
|
- provider |
|
67
|
properties: |
|
68
|
provider: |
|
69
|
type: string |
|
70
|
title: provider |
|
71
|
description: >- |
|
72
|
The ID of the MFA provider to enroll the factor with (for |
|
73
|
example, `totp`). |
|
74
|
label: |
|
75
|
type: string |
|
76
|
title: label |
|
77
|
description: >- |
|
78
|
A human-readable label to identify the factor (for example, the |
|
79
|
name of the authenticator app or device). |
|
80
|
issuer: |
|
81
|
type: string |
|
82
|
title: issuer |
|
83
|
description: >- |
|
84
|
The issuer name shown in authenticator apps for this factor. |
|
85
|
Defaults to the application name when omitted. |
|
86
|
metadata: |
|
87
|
type: object |
|
88
|
description: Additional provider-specific data to associate with the factor. |
|
89
|
x-codeSamples: |
|
90
|
- lang: JavaScript |
|
91
|
label: JS SDK |
|
92
|
source: |
|
93
|
$ref: ../code_samples/JavaScript/auth_mfa_factors/post.js |
|
94
|
- lang: Shell |
|
95
|
label: cURL |
|
96
|
source: |
|
97
|
$ref: ../code_samples/Shell/auth_mfa_factors/post.sh |
|
98
|
tags: |
|
99
|
- Multi-Factor Authentication |
|
100
|
responses: |
|
101
|
'200': |
|
102
|
description: OK |
|
103
|
'400': |
|
104
|
$ref: ../components/responses/400_error.yaml |
|
105
|
'401': |
|
106
|
$ref: ../components/responses/unauthorized.yaml |
|
107
|
'404': |
|
108
|
$ref: ../components/responses/not_found_error.yaml |
|
109
|
'409': |
|
110
|
$ref: ../components/responses/invalid_state_error.yaml |
|
111
|
'422': |
|
112
|
$ref: ../components/responses/invalid_request_error.yaml |
|
113
|
'500': |
|
114
|
$ref: ../components/responses/500_error.yaml |
|
115
|
x-since: 2.15.3 |