|
1
|
post: |
|
2
|
operationId: PostAuth_providerUser |
|
3
|
summary: Create an Admin User for an Auth Provider |
|
4
|
x-sidebar-summary: Create Admin User |
|
5
|
description: >- |
|
6
|
Create an admin user for an auth provider. This is useful for providers like |
|
7
|
OIDC where the user is created in the provider and then needs to be created |
|
8
|
in Medusa. Be careful of using this endpoint with providers like Google or |
|
9
|
GitHub, as any one can sign up as an admin user. Make sure to disable these |
|
10
|
providers for admin users using the |
|
11
|
[http.authMethodsPerActor](https://docs.medusajs.com/resources/commerce-modules/auth/auth-providers#configure-allowed-auth-providers-of-actor-types) |
|
12
|
configuration. |
|
13
|
x-authenticated: false |
|
14
|
parameters: |
|
15
|
- name: auth_provider |
|
16
|
in: path |
|
17
|
description: The ID of the auth provider to create the admin user for. |
|
18
|
required: true |
|
19
|
schema: |
|
20
|
type: string |
|
21
|
x-codeSamples: |
|
22
|
- lang: JavaScript |
|
23
|
label: JS SDK |
|
24
|
source: |
|
25
|
$ref: ../code_samples/JavaScript/auth_{auth_provider}_user/post.js |
|
26
|
- lang: Shell |
|
27
|
label: cURL |
|
28
|
source: |
|
29
|
$ref: ../code_samples/Shell/auth_{auth_provider}_user/post.sh |
|
30
|
tags: |
|
31
|
- '[auth_provider]' |
|
32
|
responses: |
|
33
|
'200': |
|
34
|
description: OK |
|
35
|
'400': |
|
36
|
$ref: ../components/responses/400_error.yaml |
|
37
|
'401': |
|
38
|
$ref: ../components/responses/unauthorized.yaml |
|
39
|
'404': |
|
40
|
$ref: ../components/responses/not_found_error.yaml |
|
41
|
'409': |
|
42
|
$ref: ../components/responses/invalid_state_error.yaml |
|
43
|
'422': |
|
44
|
$ref: ../components/responses/invalid_request_error.yaml |
|
45
|
'500': |
|
46
|
$ref: ../components/responses/500_error.yaml |
|
47
|
x-workflow: createUserAccountWorkflow |
|
48
|
x-events: |
|
49
|
- name: user.created |
|
50
|
payload: |- |
|
51
|
```ts |
|
52
|
{ |
|
53
|
id, // The ID of the user |
|
54
|
} |
|
55
|
``` |
|
56
|
description: Emitted when users are created. |
|
57
|
deprecated: false |