You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You must create a client in your service account that has access to the management API with the following scopes:
16
+
### Create a client in your Auth0 Account
17
+
You must create a client in your service account that has access to the management API with the following scopes before you can configure the a0deploy CLI.
18
+
19
+
#### Scopes
27
20
* read:tenant_settings
28
21
* update:tenant_settings
22
+
* create:client_grants
23
+
* read:client_grants
24
+
* update:client_grants
25
+
* delete:client_grants
26
+
* create:clients
29
27
* read:clients
30
28
* update:clients
31
29
* delete:clients
32
30
* read:connections
33
31
* update:connections
32
+
* create:resource_servers
33
+
* read:resource_servers
34
+
* update:resource_servers
35
+
* delete:resource_servers
34
36
* read:rules
35
37
* create:rules
36
38
* update:rules
37
39
* delete:rules
40
+
41
+
#### Client Creation Steps
42
+
Coming soon there will be an Auth0 extension you can use to initialize your environment. In the meantime, you can do it manually by following these steps:
43
+
44
+
1. log into your dashboard
45
+
1. click the clients tab
46
+
1. click the "New Client" button
47
+
1. Name it something like "Deploy Client"
48
+
1. Select Non-Interactive as the client type
49
+
1. Click Create
50
+
1. If you haven't already enabled API's, you may have to toggle the switch to enable API's
51
+
1. Use the "Select an API" dropdown to choose: "Auth0 Management API"
52
+
1. Click the Settings tab
53
+
1. Copy the client ID, you'll need it for a couple steps down
54
+
1. Click the "Documentation->Management API" link from the top menu
55
+
1. Using the left navigation click "Client Grants" then "Create a client grant"
56
+
1. Click the "create:client_grants" scope to create the token
"YOUR_STRING_KEY": "some environment specific string"
103
+
}
104
+
}
105
+
```
106
+
107
+
##### AUTH0_KEYWORD_REPLACE_MAPPINGS
108
+
The mappings are there so that you can use the same configuration file for all of your environments (e.g. dev, uat, staging, and prod) without having to have different versions of the files for each environment. The mappings allow you to replace certain values in your configuration repo with envrionment specic values. For example, you could specify a different JWT timeout in your dev environment then prod for testing:
109
+
110
+
Client .json:
111
+
```
112
+
{
113
+
...
114
+
"jwt_configuration": {
115
+
"lifetime_in_seconds": @@JWT_TIMEOUT@@,
116
+
"secret_encoded": true
117
+
}
118
+
...
119
+
}
120
+
```
121
+
122
+
Dev Config .json:
123
+
```
124
+
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
125
+
"JWT_TIMEOUT": 120,
126
+
...
127
+
}
128
+
```
129
+
130
+
Prod Config .json:
131
+
```
132
+
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
133
+
"JWT_TIMEOUT": 3600,
134
+
...
135
+
}
136
+
```
137
+
138
+
#### Organize your repository
139
+
There is more extensive documentation online for how the files are expected to be laid out to work with the source control configuration utilities [here](https://auth0.com/docs/extensions/github-deploy)
140
+
141
+
Here is a simple overview:
38
142
39
-
a0deploy [ options ]
40
-
-i,--input_file The updates to deploy. See JSON Format for more information.
41
-
-c,--config_file The JSON configuration file. See JSON Format for more information.
client1-name.meta.json # if specifying client grants
148
+
my-other-client-name.json
149
+
resource-servers
150
+
resource server 1.json
151
+
some other resource server.json
152
+
database-connections
153
+
my-connection-name
154
+
get_user.js
155
+
login.js
156
+
rules
157
+
rule1.js
158
+
rule1.json
159
+
rule2.js
160
+
pages
161
+
login.html
162
+
login.json
163
+
password_reset.html
164
+
password_reset.json
165
+
```
166
+
167
+
##### Clients
168
+
The name of the file is the name of the client that is created or updated.
169
+
170
+
In the .json file you can put the same json you would put when using the Management API for creating clients. It will only try to keep the fields specified inline with what is configured already. If a client doesn't exist yet, it will create it.
171
+
172
+
To specify client grants, you must specify the following in the metadata file. (e.g. client1-name.meta.json)
173
+
174
+
```
175
+
{
176
+
"grants": {
177
+
"Resource server audience": [
178
+
"scope1",
179
+
"scope2"
180
+
]
181
+
}
182
+
}
183
+
```
184
+
185
+
##### Resource servers
186
+
The name of the file is the name of the resource server that is created or updated.
187
+
188
+
In the .json file you can put the same json you would put when using the Management API for creating resource servers. It will only try to keep the fields specified inline with what is configured already. If a resource server doesn't exist yet, it will create it.
189
+
190
+
##### Database Connections
191
+
See Database Connection configuration [here](https://auth0.com/docs/extensions/github-deploy#deploy-database-connection-scripts)
192
+
193
+
##### Rules
194
+
See Rules configuration [here](https://auth0.com/docs/extensions/github-deploy#deploy-rules)
51
195
52
-
## JSON Formats
196
+
NOTE: There is not currently a way to mark rules as manual yet, that will become part of the configuration file in the future.
53
197
54
-
### Input File
198
+
##### Custom Pages
199
+
See Custom Pages configuration [here](https://auth0.com/docs/extensions/github-deploy#deploy-pages)
55
200
56
-
### Config File
201
+
#### Command Line Options
202
+
203
+
```
204
+
a0deploy [ options ]
205
+
-h, --help output usage information
206
+
-v,--verbose Dump extra debug information.
207
+
-i,--input_file <input file> The updates to deploy. See JSON Format for more information.
208
+
-c,--config_file <config file> The JSON configuration file. See JSON Format for more information.
209
+
-s,--state_file <state file> A file for persisting state between runs. Default: ./local/state
0 commit comments