@salesforce/plugin-auth 1.8.0 → 2.0.0
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/LICENSE.txt +1 -1
- package/README.md +385 -125
- package/lib/commands/auth/accesstoken/store.js +17 -10
- 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
|
@@ -70,52 +70,52 @@ sfdx plugins
|
|
|
70
70
|
|
|
71
71
|
<!-- commands -->
|
|
72
72
|
|
|
73
|
-
- [`sfdx auth:accesstoken:store -r <url> [-
|
|
73
|
+
- [`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]`](#sfdx-authaccesstokenstore--r-url--d--s--a-string--p---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
74
74
|
- [`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]`](#sfdx-authdevicelogin--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
75
75
|
- [`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]`](#sfdx-authjwtgrant--u-string--f-filepath--i-string--r-url--d--s--a-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
76
76
|
- [`sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-authlist---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
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
|
-
## `sfdx auth:accesstoken:store -r <url> [-
|
|
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
|
|
|
83
90
|
authorize an org using an existing Salesforce access token
|
|
84
91
|
|
|
85
92
|
```
|
|
86
|
-
authorize an org using an existing Salesforce access token
|
|
87
|
-
By default, the command runs interactively and asks you for the access token. If you previously authorized the org, the command prompts whether you want to overwrite the local file. Specify --noprompt to not be prompted.
|
|
88
|
-
To use the command in a CI/CD script, set the SFDX_ACCESS_TOKEN environment variable to the access token. Then run the command with the --noprompt parameter. "<org id>!<accesstoken>"
|
|
89
|
-
|
|
90
93
|
USAGE
|
|
91
|
-
$ sfdx auth:accesstoken:store -r <url> [-
|
|
92
|
-
|
|
94
|
+
$ sfdx auth:accesstoken:store -r <url> [-d] [-s] [-a <string>] [-p] [--json] [--loglevel
|
|
95
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
93
96
|
|
|
94
|
-
|
|
95
|
-
-a, --setalias
|
|
97
|
+
FLAGS
|
|
98
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
96
99
|
org
|
|
97
|
-
|
|
98
|
-
-p, --noprompt do not prompt for confirmation
|
|
99
|
-
|
|
100
|
-
-r, --instanceurl=instanceurl (required) the login URL of the
|
|
101
|
-
instance the org lives on
|
|
102
|
-
|
|
103
|
-
-s, --setdefaultdevhubusername set the authenticated org as the
|
|
100
|
+
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
104
101
|
default dev hub org for scratch org
|
|
105
102
|
creation
|
|
106
|
-
|
|
103
|
+
-p, --noprompt do not prompt for confirmation
|
|
104
|
+
-r, --instanceurl=<value> (required) the login URL of the
|
|
105
|
+
instance the org lives on
|
|
107
106
|
-s, --setdefaultusername set the authenticated org as the
|
|
108
107
|
default username that all commands
|
|
109
108
|
run against
|
|
110
|
-
|
|
111
109
|
--json format output as json
|
|
112
|
-
|
|
113
110
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
114
111
|
this command invocation
|
|
115
112
|
|
|
116
113
|
DESCRIPTION
|
|
114
|
+
authorize an org using an existing Salesforce access token
|
|
115
|
+
|
|
117
116
|
By default, the command runs interactively and asks you for the access token. If you previously authorized the org,
|
|
118
117
|
the command prompts whether you want to overwrite the local file. Specify --noprompt to not be prompted.
|
|
118
|
+
|
|
119
119
|
To use the command in a CI/CD script, set the SFDX_ACCESS_TOKEN environment variable to the access token. Then run the
|
|
120
120
|
command with the --noprompt parameter. "<org id>!<accesstoken>"
|
|
121
121
|
|
|
@@ -123,49 +123,44 @@ ALIASES
|
|
|
123
123
|
$ sfdx force:auth:accesstoken:store
|
|
124
124
|
|
|
125
125
|
EXAMPLES
|
|
126
|
-
sfdx auth:accesstoken:store --instanceurl https://mycompany.my.salesforce.com
|
|
126
|
+
$ sfdx auth:accesstoken:store --instanceurl https://mycompany.my.salesforce.com
|
|
127
|
+
|
|
127
128
|
export SFDX_ACCESS_TOKEN=00Dxx0000000000!xxxxx
|
|
128
|
-
|
|
129
|
+
|
|
130
|
+
$ sfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com --noprompt
|
|
129
131
|
```
|
|
130
132
|
|
|
131
|
-
_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.0/src/commands/auth/accesstoken/store.ts)_
|
|
132
134
|
|
|
133
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]`
|
|
134
136
|
|
|
135
137
|
authorize an org using a device code
|
|
136
138
|
|
|
137
139
|
```
|
|
138
|
-
authorize an org using a device code
|
|
139
|
-
You must open a browser, navigate to the verification URL, and enter the code. Log in, if not already logged in, and you’ll be prompted to allow the device to connect to the org.
|
|
140
|
-
|
|
141
140
|
USAGE
|
|
142
141
|
$ sfdx auth:device:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
143
|
-
|
|
142
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
144
143
|
|
|
145
|
-
|
|
146
|
-
-a, --setalias
|
|
144
|
+
FLAGS
|
|
145
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
147
146
|
org
|
|
148
|
-
|
|
149
147
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
150
148
|
default dev hub org for scratch org
|
|
151
149
|
creation
|
|
152
|
-
|
|
153
|
-
-i, --clientid=clientid OAuth client ID (sometimes called
|
|
150
|
+
-i, --clientid=<value> OAuth client ID (sometimes called
|
|
154
151
|
the consumer key)
|
|
155
|
-
|
|
156
|
-
-r, --instanceurl=instanceurl the login URL of the instance the
|
|
152
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
157
153
|
org lives on
|
|
158
|
-
|
|
159
154
|
-s, --setdefaultusername set the authenticated org as the
|
|
160
155
|
default username that all commands
|
|
161
156
|
run against
|
|
162
|
-
|
|
163
157
|
--json format output as json
|
|
164
|
-
|
|
165
158
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
166
159
|
this command invocation
|
|
167
160
|
|
|
168
161
|
DESCRIPTION
|
|
162
|
+
authorize an org using a device code
|
|
163
|
+
|
|
169
164
|
You must open a browser, navigate to the verification URL, and enter the code. Log in, if not already logged in, and
|
|
170
165
|
you’ll be prompted to allow the device to connect to the org.
|
|
171
166
|
|
|
@@ -173,56 +168,49 @@ ALIASES
|
|
|
173
168
|
$ sfdx force:auth:device:login
|
|
174
169
|
|
|
175
170
|
EXAMPLES
|
|
176
|
-
sfdx auth:device:login -d -a TestOrg1
|
|
177
|
-
|
|
178
|
-
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
|
|
179
176
|
```
|
|
180
177
|
|
|
181
|
-
_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.0/src/commands/auth/device/login.ts)_
|
|
182
179
|
|
|
183
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]`
|
|
184
181
|
|
|
185
182
|
authorize an org using the JWT flow
|
|
186
183
|
|
|
187
184
|
```
|
|
188
|
-
authorize an org using the JWT flow
|
|
189
|
-
Use a certificate associated with your private key that has been uploaded to a personal connected app.
|
|
190
|
-
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To specify a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
191
|
-
|
|
192
185
|
USAGE
|
|
193
|
-
$ sfdx auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json]
|
|
194
|
-
|
|
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]
|
|
195
188
|
|
|
196
|
-
|
|
197
|
-
-a, --setalias
|
|
189
|
+
FLAGS
|
|
190
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
198
191
|
org
|
|
199
|
-
|
|
200
192
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
201
193
|
default dev hub org for scratch org
|
|
202
194
|
creation
|
|
203
|
-
|
|
204
|
-
-f, --jwtkeyfile=jwtkeyfile (required) path to a file containing
|
|
195
|
+
-f, --jwtkeyfile=<value> (required) path to a file containing
|
|
205
196
|
the private key
|
|
206
|
-
|
|
207
|
-
-i, --clientid=clientid (required) OAuth client ID
|
|
197
|
+
-i, --clientid=<value> (required) OAuth client ID
|
|
208
198
|
(sometimes called the consumer key)
|
|
209
|
-
|
|
210
|
-
-r, --instanceurl=instanceurl the login URL of the instance the
|
|
199
|
+
-r, --instanceurl=<value> the login URL of the instance the
|
|
211
200
|
org lives on
|
|
212
|
-
|
|
213
201
|
-s, --setdefaultusername set the authenticated org as the
|
|
214
202
|
default username that all commands
|
|
215
203
|
run against
|
|
216
|
-
|
|
217
|
-
-u, --username=username (required) authentication username
|
|
218
|
-
|
|
204
|
+
-u, --username=<value> (required) authentication username
|
|
219
205
|
--json format output as json
|
|
220
|
-
|
|
221
206
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
222
207
|
this command invocation
|
|
223
208
|
|
|
224
209
|
DESCRIPTION
|
|
210
|
+
authorize an org using the JWT flow
|
|
211
|
+
|
|
225
212
|
Use a certificate associated with your private key that has been uploaded to a personal connected app.
|
|
213
|
+
|
|
226
214
|
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
227
215
|
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To
|
|
228
216
|
specify a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
@@ -231,118 +219,102 @@ ALIASES
|
|
|
231
219
|
$ sfdx force:auth:jwt:grant
|
|
232
220
|
|
|
233
221
|
EXAMPLES
|
|
234
|
-
sfdx auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <OAuth client id>
|
|
235
|
-
|
|
236
|
-
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
|
|
237
227
|
```
|
|
238
228
|
|
|
239
|
-
_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.0/src/commands/auth/jwt/grant.ts)_
|
|
240
230
|
|
|
241
231
|
## `sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
242
232
|
|
|
243
233
|
list auth connection information
|
|
244
234
|
|
|
245
235
|
```
|
|
246
|
-
list auth connection information
|
|
247
|
-
|
|
248
236
|
USAGE
|
|
249
237
|
$ sfdx auth:list [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
250
238
|
|
|
251
|
-
|
|
239
|
+
FLAGS
|
|
252
240
|
--json format output as json
|
|
253
|
-
|
|
254
241
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
255
242
|
this command invocation
|
|
256
243
|
|
|
244
|
+
DESCRIPTION
|
|
245
|
+
list auth connection information
|
|
246
|
+
|
|
257
247
|
ALIASES
|
|
258
248
|
$ sfdx force:auth:list
|
|
259
249
|
```
|
|
260
250
|
|
|
261
|
-
_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.0/src/commands/auth/list.ts)_
|
|
262
252
|
|
|
263
253
|
## `sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
264
254
|
|
|
265
255
|
log out from authorized orgs
|
|
266
256
|
|
|
267
257
|
```
|
|
268
|
-
log out from authorized orgs
|
|
269
|
-
By default, this command logs you out from your default scratch org.
|
|
270
|
-
|
|
271
258
|
USAGE
|
|
272
259
|
$ sfdx auth:logout [-a] [-p] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
273
|
-
|
|
260
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
274
261
|
|
|
275
|
-
|
|
262
|
+
FLAGS
|
|
276
263
|
-a, --all include all authenticated orgs
|
|
277
264
|
-p, --noprompt do not prompt for confirmation
|
|
278
|
-
|
|
279
|
-
-u, --targetusername=targetusername username or alias for the target
|
|
265
|
+
-u, --targetusername=<value> username or alias for the target
|
|
280
266
|
org; overrides default target org
|
|
281
|
-
|
|
282
|
-
--apiversion=apiversion override the api version used for
|
|
267
|
+
--apiversion=<value> override the api version used for
|
|
283
268
|
api requests made by this command
|
|
284
|
-
|
|
285
269
|
--json format output as json
|
|
286
|
-
|
|
287
270
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
288
271
|
this command invocation
|
|
289
272
|
|
|
290
273
|
DESCRIPTION
|
|
274
|
+
log out from authorized orgs
|
|
275
|
+
|
|
291
276
|
By default, this command logs you out from your default scratch org.
|
|
292
277
|
|
|
293
278
|
ALIASES
|
|
294
279
|
$ sfdx force:auth:logout
|
|
295
280
|
|
|
296
281
|
EXAMPLES
|
|
297
|
-
sfdx auth:logout -u me@my.org
|
|
298
|
-
|
|
299
|
-
sfdx auth:logout -
|
|
282
|
+
$ sfdx auth:logout -u me@my.org
|
|
283
|
+
|
|
284
|
+
$ sfdx auth:logout -a
|
|
285
|
+
|
|
286
|
+
$ sfdx auth:logout -p
|
|
300
287
|
```
|
|
301
288
|
|
|
302
|
-
_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.0/src/commands/auth/logout.ts)_
|
|
303
290
|
|
|
304
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]`
|
|
305
292
|
|
|
306
293
|
authorize an org using an SFDX auth URL stored within a file
|
|
307
294
|
|
|
308
295
|
```
|
|
309
|
-
authorize an org using an SFDX auth URL stored within a file
|
|
310
|
-
The SFDX auth URL must have the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The SFDX auth URL uses the "force" protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX auth URL doesn't include the protocol ("https://").
|
|
311
|
-
|
|
312
|
-
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx force:org:display --verbose --json` command into a file. For example, using an org you have already authorized:
|
|
313
|
-
|
|
314
|
-
$ sfdx force:org:display -u <OrgUsername> --verbose --json > authFile.json
|
|
315
|
-
$ sfdx auth:sfdxurl:store -f authFile.json
|
|
316
|
-
|
|
317
|
-
The resulting JSON file contains the URL in the sfdxAuthUrl property inside of a results object. NOTE: The `force:org:display --verbose` command displays the refresh token only for orgs authorized with the web server flow, and not the JWT bearer flow.
|
|
318
|
-
|
|
319
|
-
You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the auth URL. Finally, you can create a normal text file that includes just the URL and nothing else.
|
|
320
|
-
|
|
321
296
|
USAGE
|
|
322
297
|
$ sfdx auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
323
|
-
|
|
298
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
324
299
|
|
|
325
|
-
|
|
326
|
-
-a, --setalias
|
|
300
|
+
FLAGS
|
|
301
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
327
302
|
org
|
|
328
|
-
|
|
329
303
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
330
304
|
default dev hub org for scratch org
|
|
331
305
|
creation
|
|
332
|
-
|
|
333
|
-
-f, --sfdxurlfile=sfdxurlfile (required) path to a file containing
|
|
306
|
+
-f, --sfdxurlfile=<value> (required) path to a file containing
|
|
334
307
|
the sfdx url
|
|
335
|
-
|
|
336
308
|
-s, --setdefaultusername set the authenticated org as the
|
|
337
309
|
default username that all commands
|
|
338
310
|
run against
|
|
339
|
-
|
|
340
311
|
--json format output as json
|
|
341
|
-
|
|
342
312
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
343
313
|
this command invocation
|
|
344
314
|
|
|
345
315
|
DESCRIPTION
|
|
316
|
+
authorize an org using an SFDX auth URL stored within a file
|
|
317
|
+
|
|
346
318
|
The SFDX auth URL must have the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The
|
|
347
319
|
SFDX auth URL uses the "force" protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX auth URL
|
|
348
320
|
doesn't include the protocol ("https://").
|
|
@@ -350,8 +322,9 @@ DESCRIPTION
|
|
|
350
322
|
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx
|
|
351
323
|
force:org:display --verbose --json` command into a file. For example, using an org you have already authorized:
|
|
352
324
|
|
|
353
|
-
|
|
354
|
-
|
|
325
|
+
$ sfdx force:org:display -u <OrgUsername> --verbose --json > authFile.json
|
|
326
|
+
|
|
327
|
+
$ sfdx auth:sfdxurl:store -f authFile.json
|
|
355
328
|
|
|
356
329
|
The resulting JSON file contains the URL in the sfdxAuthUrl property inside of a results object. NOTE: The
|
|
357
330
|
`force:org:display --verbose` command displays the refresh token only for orgs authorized with the web server flow,
|
|
@@ -364,48 +337,335 @@ ALIASES
|
|
|
364
337
|
$ sfdx force:auth:sfdxurl:store
|
|
365
338
|
|
|
366
339
|
EXAMPLES
|
|
367
|
-
sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
|
|
368
|
-
|
|
340
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
|
|
341
|
+
|
|
342
|
+
$ sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file> -s -a MyDefaultOrg
|
|
369
343
|
```
|
|
370
344
|
|
|
371
|
-
_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.0/src/commands/auth/sfdxurl/store.ts)_
|
|
372
346
|
|
|
373
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]`
|
|
374
348
|
|
|
375
349
|
authorize an org using the web login flow
|
|
376
350
|
|
|
377
351
|
```
|
|
378
|
-
authorize an org using the web login flow
|
|
379
|
-
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log in to a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
380
|
-
|
|
381
352
|
USAGE
|
|
382
353
|
$ sfdx auth:web:login [-i <string>] [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel
|
|
383
|
-
|
|
354
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
384
355
|
|
|
385
|
-
|
|
386
|
-
-a, --setalias
|
|
356
|
+
FLAGS
|
|
357
|
+
-a, --setalias=<value> set an alias for the authenticated
|
|
387
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
|
|
388
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
|
|
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.0/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
|
|
389
405
|
-d, --setdefaultdevhubusername set the authenticated org as the
|
|
390
406
|
default dev hub org for scratch org
|
|
391
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
|
|
392
417
|
|
|
393
|
-
|
|
394
|
-
|
|
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
|
|
432
|
+
|
|
433
|
+
export SFDX_ACCESS_TOKEN=00Dxx0000000000!xxxxx
|
|
434
|
+
|
|
435
|
+
$ sfdx auth:accesstoken:store --instanceurl https://dev-hub.my.salesforce.com --noprompt
|
|
436
|
+
```
|
|
395
437
|
|
|
396
|
-
|
|
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
|
|
397
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
|
|
398
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
|
+
```
|
|
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
|
|
399
502
|
-s, --setdefaultusername set the authenticated org as the
|
|
400
503
|
default username that all commands
|
|
401
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
|
|
402
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
|
|
403
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
|
|
404
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]
|
|
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
|
|
405
567
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
406
568
|
this command invocation
|
|
407
569
|
|
|
408
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
|
+
|
|
409
669
|
If you specify an --instanceurl value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To
|
|
410
670
|
specify a My Domain URL, use the format MyDomainName.my.salesforce.com (not MyDomainName.lightning.force.com). To log
|
|
411
671
|
in to a sandbox, set --instanceurl to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
|
|
@@ -414,11 +674,11 @@ ALIASES
|
|
|
414
674
|
$ sfdx force:auth:web:login
|
|
415
675
|
|
|
416
676
|
EXAMPLES
|
|
417
|
-
sfdx auth:web:login -a TestOrg1
|
|
418
|
-
sfdx auth:web:login -i <OAuth client id>
|
|
419
|
-
sfdx auth:web:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
420
|
-
```
|
|
677
|
+
$ sfdx auth:web:login -a TestOrg1
|
|
421
678
|
|
|
422
|
-
|
|
679
|
+
$ sfdx auth:web:login -i <OAuth client id>
|
|
680
|
+
|
|
681
|
+
$ sfdx auth:web:login -r https://MyDomainName--SandboxName.sandbox.my.salesforce.com
|
|
682
|
+
```
|
|
423
683
|
|
|
424
684
|
<!-- commandsstop -->
|