@salesforce/plugin-auth 1.8.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +380 -89
- package/lib/commands/auth/accesstoken/store.js +16 -9
- package/lib/commands/auth/accesstoken/store.js.map +1 -1
- package/lib/commands/auth/device/login.js +6 -2
- package/lib/commands/auth/device/login.js.map +1 -1
- package/lib/commands/auth/jwt/grant.js +7 -3
- package/lib/commands/auth/jwt/grant.js.map +1 -1
- package/lib/commands/auth/list.d.ts +2 -2
- package/lib/commands/auth/list.js +16 -9
- package/lib/commands/auth/list.js.map +1 -1
- package/lib/commands/auth/logout.js +24 -11
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/sfdxurl/store.js +13 -5
- package/lib/commands/auth/sfdxurl/store.js.map +1 -1
- package/lib/commands/auth/web/login.js +8 -4
- package/lib/commands/auth/web/login.js.map +1 -1
- package/lib/common.d.ts +0 -10
- package/lib/common.js +3 -60
- package/lib/common.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +20 -14
package/README.md
CHANGED
|
@@ -77,6 +77,13 @@ sfdx plugins
|
|
|
77
77
|
- [`sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlogout--a--p--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
78
78
|
- [`sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authsfdxurlstore--f-filepath--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
79
79
|
- [`sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authweblogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
80
|
+
- [`sfdx force:auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthaccesstokenstore--r-url--d--s--a-string--p---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
81
|
+
- [`sfdx force:auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthdevicelogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
82
|
+
- [`sfdx force:auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthjwtgrant--u-string--f-filepath--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
83
|
+
- [`sfdx force:auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthlist---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
84
|
+
- [`sfdx force:auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthlogout--a--p--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
85
|
+
- [`sfdx force:auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthsfdxurlstore--f-filepath--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
86
|
+
- [`sfdx force:auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forceauthweblogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
80
87
|
|
|
81
88
|
## `sfdx auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
82
89
|
|
|
@@ -85,46 +92,45 @@ authorize an org using an existing Salesforce access token
|
|
|
85
92
|
```
|
|
86
93
|
USAGE
|
|
87
94
|
$ sfdx auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel
|
|
88
|
-
|
|
95
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
-a, --setalias
|
|
97
|
+
FLAGS
|
|
98
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
92
99
|
org
|
|
93
|
-
|
|
94
100
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
95
101
|
default dev hub org for scratch org
|
|
96
102
|
creation
|
|
97
|
-
|
|
98
103
|
-p, --noprompt do not prompt for confirmation
|
|
99
|
-
|
|
100
|
-
-r, --instanceurl=instanceurl (required) the login URL of the
|
|
104
|
+
-r, --instanceurl=<value> (required) the login URL of the
|
|
101
105
|
instance the org lives on
|
|
102
|
-
|
|
103
106
|
-s, --setdefaultusername set the authenticated org as the
|
|
104
107
|
default username that all commands
|
|
105
108
|
run against
|
|
106
|
-
|
|
107
109
|
--json format output as json
|
|
108
|
-
|
|
109
110
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
110
111
|
this command invocation
|
|
111
112
|
|
|
112
113
|
DESCRIPTION
|
|
114
|
+
authorize an org using an existing Salesforce access token
|
|
115
|
+
|
|
113
116
|
By default, the command runs interactively and asks you for the access token. If you previously authorized the org,
|
|
114
117
|
the command prompts whether you want to overwrite the local file. Specify --noprompt to not be prompted.
|
|
118
|
+
|
|
115
119
|
To use the command in a CI/CD script, set the SFDX_ACCESS_TOKEN environment variable to the access token. Then run the
|
|
116
|
-
|
|
120
|
+
command with the --noprompt parameter. "<org id>!<accesstoken>"
|
|
117
121
|
|
|
118
122
|
ALIASES
|
|
119
123
|
$ sfdx force:auth:accesstoken:store
|
|
120
124
|
|
|
121
125
|
EXAMPLES
|
|
122
|
-
sfdx auth:accesstoken:store --instanceurl https://mycompany.my.salesforce.com
|
|
126
|
+
$ sfdx auth:accesstoken:store --instanceurl https://mycompany.my.salesforce.com
|
|
127
|
+
|
|
123
128
|
export SFDX_ACCESS_TOKEN=00Dxx0000000000!xxxxx
|
|
124
|
-
|
|
129
|
+
|
|
130
|
+
$ sfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com --noprompt
|
|
125
131
|
```
|
|
126
132
|
|
|
127
|
-
_See code: [src/commands/auth/accesstoken/store.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
133
|
+
_See code: [src/commands/auth/accesstoken/store.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/accesstoken/store.ts)_
|
|
128
134
|
|
|
129
135
|
## `sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
130
136
|
|
|
@@ -133,32 +139,28 @@ authorize an org using a device code
|
|
|
133
139
|
```
|
|
134
140
|
USAGE
|
|
135
141
|
$ sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
136
|
-
|
|
142
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
137
143
|
|
|
138
|
-
|
|
139
|
-
-a, --setalias
|
|
144
|
+
FLAGS
|
|
145
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
140
146
|
org
|
|
141
|
-
|
|
142
147
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
143
148
|
default dev hub org for scratch org
|
|
144
149
|
creation
|
|
145
|
-
|
|
146
|
-
-i, --clientid=clientid OAuth client ID (sometimes called
|
|
150
|
+
-i, --clientid=<value> OAuth client ID (sometimes called
|
|
147
151
|
the consumer key)
|
|
148
|
-
|
|
149
|
-
-r, --instanceurl=instanceurl the login URL of the instance the
|
|
152
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
150
153
|
org lives on
|
|
151
|
-
|
|
152
154
|
-s, --setdefaultusername set the authenticated org as the
|
|
153
155
|
default username that all commands
|
|
154
156
|
run against
|
|
155
|
-
|
|
156
157
|
--json format output as json
|
|
157
|
-
|
|
158
158
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
159
159
|
this command invocation
|
|
160
160
|
|
|
161
161
|
DESCRIPTION
|
|
162
|
+
authorize an org using a device code
|
|
163
|
+
|
|
162
164
|
You must open a browser, navigate to the verification URL, and enter the code. Log in, if not already logged in, and
|
|
163
165
|
you’ll be prompted to allow the device to connect to the org.
|
|
164
166
|
|
|
@@ -166,12 +168,14 @@ ALIASES
|
|
|
166
168
|
$ sfdx force:auth:device:login
|
|
167
169
|
|
|
168
170
|
EXAMPLES
|
|
169
|
-
sfdx auth:device:login -d -a TestOrg1
|
|
170
|
-
|
|
171
|
-
sfdx auth:device:login -
|
|
171
|
+
$ sfdx auth:device:login -d -a TestOrg1
|
|
172
|
+
|
|
173
|
+
$ sfdx auth:device:login -i <OAuth client id>
|
|
174
|
+
|
|
175
|
+
$ sfdx auth:device:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
172
176
|
```
|
|
173
177
|
|
|
174
|
-
_See code: [src/commands/auth/device/login.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
178
|
+
_See code: [src/commands/auth/device/login.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/device/login.ts)_
|
|
175
179
|
|
|
176
180
|
## `sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
177
181
|
|
|
@@ -179,39 +183,34 @@ authorize an org using the JWT flow
|
|
|
179
183
|
|
|
180
184
|
```
|
|
181
185
|
USAGE
|
|
182
|
-
$ sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json]
|
|
183
|
-
|
|
186
|
+
$ sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json]
|
|
187
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
184
188
|
|
|
185
|
-
|
|
186
|
-
-a, --setalias
|
|
189
|
+
FLAGS
|
|
190
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
187
191
|
org
|
|
188
|
-
|
|
189
192
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
190
193
|
default dev hub org for scratch org
|
|
191
194
|
creation
|
|
192
|
-
|
|
193
|
-
-f, --jwtkeyfile=jwtkeyfile (required) path to a file containing
|
|
195
|
+
-f, --jwtkeyfile=<value> (required) path to a file containing
|
|
194
196
|
the private key
|
|
195
|
-
|
|
196
|
-
-i, --clientid=clientid (required) OAuth client ID
|
|
197
|
+
-i, --clientid=<value> (required) OAuth client ID
|
|
197
198
|
(sometimes called the consumer key)
|
|
198
|
-
|
|
199
|
-
-r, --instanceurl=instanceurl the login URL of the instance the
|
|
199
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
200
200
|
org lives on
|
|
201
|
-
|
|
202
201
|
-s, --setdefaultusername set the authenticated org as the
|
|
203
202
|
default username that all commands
|
|
204
203
|
run against
|
|
205
|
-
|
|
206
|
-
-u, --username=username (required) authentication username
|
|
207
|
-
|
|
204
|
+
-u, --username=<value> (required) authentication username
|
|
208
205
|
--json format output as json
|
|
209
|
-
|
|
210
206
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
211
207
|
this command invocation
|
|
212
208
|
|
|
213
209
|
DESCRIPTION
|
|
210
|
+
authorize an org using the JWT flow
|
|
211
|
+
|
|
214
212
|
Use a certificate associated with your private key that has been uploaded to a personal connected app.
|
|
213
|
+
|
|
215
214
|
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
216
215
|
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To
|
|
217
216
|
specify a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
@@ -220,12 +219,14 @@ ALIASES
|
|
|
220
219
|
$ sfdx force:auth:jwt:grant
|
|
221
220
|
|
|
222
221
|
EXAMPLES
|
|
223
|
-
sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id>
|
|
224
|
-
|
|
225
|
-
sfdx auth:jwt:grant -u me@
|
|
222
|
+
$ sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id>
|
|
223
|
+
|
|
224
|
+
$ sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id> -s -a MyDefaultOrg
|
|
225
|
+
|
|
226
|
+
$ sfdx auth:jwt:grant -u me@acme.org -f <path to jwt key file> -i <OAuth client id> -r https://acme.my.salesforce.com
|
|
226
227
|
```
|
|
227
228
|
|
|
228
|
-
_See code: [src/commands/auth/jwt/grant.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
229
|
+
_See code: [src/commands/auth/jwt/grant.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/jwt/grant.ts)_
|
|
229
230
|
|
|
230
231
|
## `sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
231
232
|
|
|
@@ -235,17 +236,19 @@ list auth connection information
|
|
|
235
236
|
USAGE
|
|
236
237
|
$ sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
237
238
|
|
|
238
|
-
|
|
239
|
+
FLAGS
|
|
239
240
|
--json format output as json
|
|
240
|
-
|
|
241
241
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
242
242
|
this command invocation
|
|
243
243
|
|
|
244
|
+
DESCRIPTION
|
|
245
|
+
list auth connection information
|
|
246
|
+
|
|
244
247
|
ALIASES
|
|
245
248
|
$ sfdx force:auth:list
|
|
246
249
|
```
|
|
247
250
|
|
|
248
|
-
_See code: [src/commands/auth/list.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
251
|
+
_See code: [src/commands/auth/list.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/list.ts)_
|
|
249
252
|
|
|
250
253
|
## `sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
251
254
|
|
|
@@ -254,36 +257,36 @@ log out from authorized orgs
|
|
|
254
257
|
```
|
|
255
258
|
USAGE
|
|
256
259
|
$ sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
257
|
-
|
|
260
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
258
261
|
|
|
259
|
-
|
|
262
|
+
FLAGS
|
|
260
263
|
-a, --all include all authenticated orgs
|
|
261
264
|
-p, --noprompt do not prompt for confirmation
|
|
262
|
-
|
|
263
|
-
-u, --targetusername=targetusername username or alias for the target
|
|
265
|
+
-u, --targetusername=<value> username or alias for the target
|
|
264
266
|
org; overrides default target org
|
|
265
|
-
|
|
266
|
-
--apiversion=apiversion override the api version used for
|
|
267
|
+
--apiversion=<value> override the api version used for
|
|
267
268
|
api requests made by this command
|
|
268
|
-
|
|
269
269
|
--json format output as json
|
|
270
|
-
|
|
271
270
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
272
271
|
this command invocation
|
|
273
272
|
|
|
274
273
|
DESCRIPTION
|
|
274
|
+
log out from authorized orgs
|
|
275
|
+
|
|
275
276
|
By default, this command logs you out from your default scratch org.
|
|
276
277
|
|
|
277
278
|
ALIASES
|
|
278
279
|
$ sfdx force:auth:logout
|
|
279
280
|
|
|
280
281
|
EXAMPLES
|
|
281
|
-
sfdx auth:logout -u me@my.org
|
|
282
|
-
|
|
283
|
-
sfdx auth:logout -
|
|
282
|
+
$ sfdx auth:logout -u me@my.org
|
|
283
|
+
|
|
284
|
+
$ sfdx auth:logout -a
|
|
285
|
+
|
|
286
|
+
$ sfdx auth:logout -p
|
|
284
287
|
```
|
|
285
288
|
|
|
286
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
289
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/logout.ts)_
|
|
287
290
|
|
|
288
291
|
## `sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
289
292
|
|
|
@@ -292,29 +295,26 @@ authorize an org using an SFDX auth URL stored within a file
|
|
|
292
295
|
```
|
|
293
296
|
USAGE
|
|
294
297
|
$ sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
295
|
-
|
|
298
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
296
299
|
|
|
297
|
-
|
|
298
|
-
-a, --setalias
|
|
300
|
+
FLAGS
|
|
301
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
299
302
|
org
|
|
300
|
-
|
|
301
303
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
302
304
|
default dev hub org for scratch org
|
|
303
305
|
creation
|
|
304
|
-
|
|
305
|
-
-f, --sfdxurlfile=sfdxurlfile (required) path to a file containing
|
|
306
|
+
-f, --sfdxurlfile=<value> (required) path to a file containing
|
|
306
307
|
the sfdx url
|
|
307
|
-
|
|
308
308
|
-s, --setdefaultusername set the authenticated org as the
|
|
309
309
|
default username that all commands
|
|
310
310
|
run against
|
|
311
|
-
|
|
312
311
|
--json format output as json
|
|
313
|
-
|
|
314
312
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
315
313
|
this command invocation
|
|
316
314
|
|
|
317
315
|
DESCRIPTION
|
|
316
|
+
authorize an org using an SFDX auth URL stored within a file
|
|
317
|
+
|
|
318
318
|
The SFDX auth URL must have the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The
|
|
319
319
|
SFDX auth URL uses the "force" protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX auth URL
|
|
320
320
|
doesn't include the protocol ("https://").
|
|
@@ -322,8 +322,9 @@ DESCRIPTION
|
|
|
322
322
|
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx
|
|
323
323
|
force:org:display --verbose --json` command into a file. For example, using an org you have already authorized:
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
$ sfdx force:org:display -u <OrgUsername> --verbose --json > authFile.json
|
|
326
|
+
|
|
327
|
+
$ sfdx auth:sfdxurl:store -f authFile.json
|
|
327
328
|
|
|
328
329
|
The resulting JSON file contains the URL in the sfdxAuthUrl property inside of a results object. NOTE: The
|
|
329
330
|
`force:org:display --verbose` command displays the refresh token only for orgs authorized with the web server flow,
|
|
@@ -336,11 +337,12 @@ ALIASES
|
|
|
336
337
|
$ sfdx force:auth:sfdxurl:store
|
|
337
338
|
|
|
338
339
|
EXAMPLES
|
|
339
|
-
sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
|
|
340
|
-
|
|
340
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
|
|
341
|
+
|
|
342
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file> -s -a MyDefaultOrg
|
|
341
343
|
```
|
|
342
344
|
|
|
343
|
-
_See code: [src/commands/auth/sfdxurl/store.ts](https://github.com/salesforcecli/plugin-auth/blob/
|
|
345
|
+
_See code: [src/commands/auth/sfdxurl/store.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/sfdxurl/store.ts)_
|
|
344
346
|
|
|
345
347
|
## `sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
346
348
|
|
|
@@ -349,32 +351,321 @@ authorize an org using the web login flow
|
|
|
349
351
|
```
|
|
350
352
|
USAGE
|
|
351
353
|
$ sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
352
|
-
|
|
354
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
353
355
|
|
|
354
|
-
|
|
355
|
-
-a, --setalias
|
|
356
|
+
FLAGS
|
|
357
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
356
358
|
org
|
|
359
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
360
|
+
default dev hub org for scratch org
|
|
361
|
+
creation
|
|
362
|
+
-i, --clientid=<value> OAuth client ID (sometimes called
|
|
363
|
+
the consumer key)
|
|
364
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
365
|
+
org lives on
|
|
366
|
+
-s, --setdefaultusername set the authenticated org as the
|
|
367
|
+
default username that all commands
|
|
368
|
+
run against
|
|
369
|
+
--json format output as json
|
|
370
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
371
|
+
this command invocation
|
|
372
|
+
|
|
373
|
+
DESCRIPTION
|
|
374
|
+
authorize an org using the web login flow
|
|
375
|
+
|
|
376
|
+
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
377
|
+
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log
|
|
378
|
+
in to a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
379
|
+
|
|
380
|
+
ALIASES
|
|
381
|
+
$ sfdx force:auth:web:login
|
|
382
|
+
|
|
383
|
+
EXAMPLES
|
|
384
|
+
$ sfdx auth:web:login -a TestOrg1
|
|
357
385
|
|
|
386
|
+
$ sfdx auth:web:login -i <OAuth client id>
|
|
387
|
+
|
|
388
|
+
$ sfdx auth:web:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
_See code: [src/commands/auth/web/login.ts](https://github.com/salesforcecli/plugin-auth/blob/v2.0.1/src/commands/auth/web/login.ts)_
|
|
392
|
+
|
|
393
|
+
## `sfdx force:auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
394
|
+
|
|
395
|
+
authorize an org using an existing Salesforce access token
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
USAGE
|
|
399
|
+
$ sfdx force:auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel
|
|
400
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
401
|
+
|
|
402
|
+
FLAGS
|
|
403
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
404
|
+
org
|
|
358
405
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
359
406
|
default dev hub org for scratch org
|
|
360
407
|
creation
|
|
408
|
+
-p, --noprompt do not prompt for confirmation
|
|
409
|
+
-r, --instanceurl=<value> (required) the login URL of the
|
|
410
|
+
instance the org lives on
|
|
411
|
+
-s, --setdefaultusername set the authenticated org as the
|
|
412
|
+
default username that all commands
|
|
413
|
+
run against
|
|
414
|
+
--json format output as json
|
|
415
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
416
|
+
this command invocation
|
|
361
417
|
|
|
362
|
-
|
|
363
|
-
|
|
418
|
+
DESCRIPTION
|
|
419
|
+
authorize an org using an existing Salesforce access token
|
|
420
|
+
|
|
421
|
+
By default, the command runs interactively and asks you for the access token. If you previously authorized the org,
|
|
422
|
+
the command prompts whether you want to overwrite the local file. Specify --noprompt to not be prompted.
|
|
423
|
+
|
|
424
|
+
To use the command in a CI/CD script, set the SFDX_ACCESS_TOKEN environment variable to the access token. Then run the
|
|
425
|
+
command with the --noprompt parameter. "<org id>!<accesstoken>"
|
|
426
|
+
|
|
427
|
+
ALIASES
|
|
428
|
+
$ sfdx force:auth:accesstoken:store
|
|
429
|
+
|
|
430
|
+
EXAMPLES
|
|
431
|
+
$ sfdx auth:accesstoken:store --instanceurl https://mycompany.my.salesforce.com
|
|
364
432
|
|
|
365
|
-
|
|
433
|
+
export SFDX_ACCESS_TOKEN=00Dxx0000000000!xxxxx
|
|
434
|
+
|
|
435
|
+
$ sfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com --noprompt
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## `sfdx force:auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
439
|
+
|
|
440
|
+
authorize an org using a device code
|
|
441
|
+
|
|
442
|
+
```
|
|
443
|
+
USAGE
|
|
444
|
+
$ sfdx force:auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
445
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
446
|
+
|
|
447
|
+
FLAGS
|
|
448
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
449
|
+
org
|
|
450
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
451
|
+
default dev hub org for scratch org
|
|
452
|
+
creation
|
|
453
|
+
-i, --clientid=<value> OAuth client ID (sometimes called
|
|
454
|
+
the consumer key)
|
|
455
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
366
456
|
org lives on
|
|
457
|
+
-s, --setdefaultusername set the authenticated org as the
|
|
458
|
+
default username that all commands
|
|
459
|
+
run against
|
|
460
|
+
--json format output as json
|
|
461
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
462
|
+
this command invocation
|
|
463
|
+
|
|
464
|
+
DESCRIPTION
|
|
465
|
+
authorize an org using a device code
|
|
466
|
+
|
|
467
|
+
You must open a browser, navigate to the verification URL, and enter the code. Log in, if not already logged in, and
|
|
468
|
+
you’ll be prompted to allow the device to connect to the org.
|
|
469
|
+
|
|
470
|
+
ALIASES
|
|
471
|
+
$ sfdx force:auth:device:login
|
|
472
|
+
|
|
473
|
+
EXAMPLES
|
|
474
|
+
$ sfdx auth:device:login -d -a TestOrg1
|
|
475
|
+
|
|
476
|
+
$ sfdx auth:device:login -i <OAuth client id>
|
|
477
|
+
|
|
478
|
+
$ sfdx auth:device:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
479
|
+
```
|
|
367
480
|
|
|
481
|
+
## `sfdx force:auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
482
|
+
|
|
483
|
+
authorize an org using the JWT flow
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
USAGE
|
|
487
|
+
$ sfdx force:auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json]
|
|
488
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
489
|
+
|
|
490
|
+
FLAGS
|
|
491
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
492
|
+
org
|
|
493
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
494
|
+
default dev hub org for scratch org
|
|
495
|
+
creation
|
|
496
|
+
-f, --jwtkeyfile=<value> (required) path to a file containing
|
|
497
|
+
the private key
|
|
498
|
+
-i, --clientid=<value> (required) OAuth client ID
|
|
499
|
+
(sometimes called the consumer key)
|
|
500
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
501
|
+
org lives on
|
|
368
502
|
-s, --setdefaultusername set the authenticated org as the
|
|
369
503
|
default username that all commands
|
|
370
504
|
run against
|
|
505
|
+
-u, --username=<value> (required) authentication username
|
|
506
|
+
--json format output as json
|
|
507
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
508
|
+
this command invocation
|
|
509
|
+
|
|
510
|
+
DESCRIPTION
|
|
511
|
+
authorize an org using the JWT flow
|
|
512
|
+
|
|
513
|
+
Use a certificate associated with your private key that has been uploaded to a personal connected app.
|
|
514
|
+
|
|
515
|
+
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
516
|
+
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To
|
|
517
|
+
specify a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
518
|
+
|
|
519
|
+
ALIASES
|
|
520
|
+
$ sfdx force:auth:jwt:grant
|
|
521
|
+
|
|
522
|
+
EXAMPLES
|
|
523
|
+
$ sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id>
|
|
524
|
+
|
|
525
|
+
$ sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id> -s -a MyDefaultOrg
|
|
526
|
+
|
|
527
|
+
$ sfdx auth:jwt:grant -u me@acme.org -f <path to jwt key file> -i <OAuth client id> -r https://acme.my.salesforce.com
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
## `sfdx force:auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
531
|
+
|
|
532
|
+
list auth connection information
|
|
371
533
|
|
|
534
|
+
```
|
|
535
|
+
USAGE
|
|
536
|
+
$ sfdx force:auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
537
|
+
|
|
538
|
+
FLAGS
|
|
372
539
|
--json format output as json
|
|
540
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
541
|
+
this command invocation
|
|
542
|
+
|
|
543
|
+
DESCRIPTION
|
|
544
|
+
list auth connection information
|
|
545
|
+
|
|
546
|
+
ALIASES
|
|
547
|
+
$ sfdx force:auth:list
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
## `sfdx force:auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
551
|
+
|
|
552
|
+
log out from authorized orgs
|
|
553
|
+
|
|
554
|
+
```
|
|
555
|
+
USAGE
|
|
556
|
+
$ sfdx force:auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
557
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
373
558
|
|
|
559
|
+
FLAGS
|
|
560
|
+
-a, --all include all authenticated orgs
|
|
561
|
+
-p, --noprompt do not prompt for confirmation
|
|
562
|
+
-u, --targetusername=<value> username or alias for the target
|
|
563
|
+
org; overrides default target org
|
|
564
|
+
--apiversion=<value> override the api version used for
|
|
565
|
+
api requests made by this command
|
|
566
|
+
--json format output as json
|
|
374
567
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
375
568
|
this command invocation
|
|
376
569
|
|
|
377
570
|
DESCRIPTION
|
|
571
|
+
log out from authorized orgs
|
|
572
|
+
|
|
573
|
+
By default, this command logs you out from your default scratch org.
|
|
574
|
+
|
|
575
|
+
ALIASES
|
|
576
|
+
$ sfdx force:auth:logout
|
|
577
|
+
|
|
578
|
+
EXAMPLES
|
|
579
|
+
$ sfdx auth:logout -u me@my.org
|
|
580
|
+
|
|
581
|
+
$ sfdx auth:logout -a
|
|
582
|
+
|
|
583
|
+
$ sfdx auth:logout -p
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
## `sfdx force:auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
587
|
+
|
|
588
|
+
authorize an org using an SFDX auth URL stored within a file
|
|
589
|
+
|
|
590
|
+
```
|
|
591
|
+
USAGE
|
|
592
|
+
$ sfdx force:auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
593
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
594
|
+
|
|
595
|
+
FLAGS
|
|
596
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
597
|
+
org
|
|
598
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
599
|
+
default dev hub org for scratch org
|
|
600
|
+
creation
|
|
601
|
+
-f, --sfdxurlfile=<value> (required) path to a file containing
|
|
602
|
+
the sfdx url
|
|
603
|
+
-s, --setdefaultusername set the authenticated org as the
|
|
604
|
+
default username that all commands
|
|
605
|
+
run against
|
|
606
|
+
--json format output as json
|
|
607
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
608
|
+
this command invocation
|
|
609
|
+
|
|
610
|
+
DESCRIPTION
|
|
611
|
+
authorize an org using an SFDX auth URL stored within a file
|
|
612
|
+
|
|
613
|
+
The SFDX auth URL must have the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The
|
|
614
|
+
SFDX auth URL uses the "force" protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX auth URL
|
|
615
|
+
doesn't include the protocol ("https://").
|
|
616
|
+
|
|
617
|
+
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx
|
|
618
|
+
force:org:display --verbose --json` command into a file. For example, using an org you have already authorized:
|
|
619
|
+
|
|
620
|
+
$ sfdx force:org:display -u <OrgUsername> --verbose --json > authFile.json
|
|
621
|
+
|
|
622
|
+
$ sfdx auth:sfdxurl:store -f authFile.json
|
|
623
|
+
|
|
624
|
+
The resulting JSON file contains the URL in the sfdxAuthUrl property inside of a results object. NOTE: The
|
|
625
|
+
`force:org:display --verbose` command displays the refresh token only for orgs authorized with the web server flow,
|
|
626
|
+
and not the JWT bearer flow.
|
|
627
|
+
|
|
628
|
+
You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the auth URL. Finally,
|
|
629
|
+
you can create a normal text file that includes just the URL and nothing else.
|
|
630
|
+
|
|
631
|
+
ALIASES
|
|
632
|
+
$ sfdx force:auth:sfdxurl:store
|
|
633
|
+
|
|
634
|
+
EXAMPLES
|
|
635
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
|
|
636
|
+
|
|
637
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file> -s -a MyDefaultOrg
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
## `sfdx force:auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
641
|
+
|
|
642
|
+
authorize an org using the web login flow
|
|
643
|
+
|
|
644
|
+
```
|
|
645
|
+
USAGE
|
|
646
|
+
$ sfdx force:auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
647
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
648
|
+
|
|
649
|
+
FLAGS
|
|
650
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
651
|
+
org
|
|
652
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
653
|
+
default dev hub org for scratch org
|
|
654
|
+
creation
|
|
655
|
+
-i, --clientid=<value> OAuth client ID (sometimes called
|
|
656
|
+
the consumer key)
|
|
657
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
658
|
+
org lives on
|
|
659
|
+
-s, --setdefaultusername set the authenticated org as the
|
|
660
|
+
default username that all commands
|
|
661
|
+
run against
|
|
662
|
+
--json format output as json
|
|
663
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
664
|
+
this command invocation
|
|
665
|
+
|
|
666
|
+
DESCRIPTION
|
|
667
|
+
authorize an org using the web login flow
|
|
668
|
+
|
|
378
669
|
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
379
670
|
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log
|
|
380
671
|
in to a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
@@ -383,11 +674,11 @@ ALIASES
|
|
|
383
674
|
$ sfdx force:auth:web:login
|
|
384
675
|
|
|
385
676
|
EXAMPLES
|
|
386
|
-
sfdx auth:web:login -a TestOrg1
|
|
387
|
-
sfdx auth:web:login -i <OAuth client id>
|
|
388
|
-
sfdx auth:web:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
389
|
-
```
|
|
677
|
+
$ sfdx auth:web:login -a TestOrg1
|
|
390
678
|
|
|
391
|
-
|
|
679
|
+
$ sfdx auth:web:login -i <OAuth client id>
|
|
680
|
+
|
|
681
|
+
$ sfdx auth:web:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
682
|
+
```
|
|
392
683
|
|
|
393
684
|
<!-- commandsstop -->
|