|
276 | 276 | " const username = encodeURIComponent(pm.variables.get(\"auth-username\"));",
|
277 | 277 | " const password = encodeURIComponent(pm.variables.get(\"auth-password\"));",
|
278 | 278 | " const client_secret = pm.variables.get(\"auth-client-secret\");",
|
| 279 | + " var cs = \"\"", |
| 280 | + " if(client_secret) {", |
| 281 | + " cs = \"&client_secret=\" + client_secret", |
| 282 | + " }", |
279 | 283 | " const client_id = pm.variables.get(\"auth-client-id\")",
|
280 |
| - " const body = \"client_id=\" + client_id + \"&client_secret=\" + client_secret + \"&grant_type=password&username=\" + username + \"&password=\" + password", |
| 284 | + " const body = \"client_id=\" + client_id + cs + \"&grant_type=password&username=\" + username + \"&password=\" + password", |
281 | 285 | " console.log(body)",
|
282 | 286 | " pm.sendRequest({",
|
283 | 287 | " url: pm.variables.get(\"auth-url\"),",
|
|
317 | 321 | ],
|
318 | 322 | "variable": [
|
319 | 323 | {
|
320 |
| - "id": "b6f9b509-b8ee-4d55-8242-8d535ecd989c", |
| 324 | + "id": "d59744f7-253b-4153-8abe-24c79e608211", |
321 | 325 | "key": "url",
|
322 | 326 | "value": "http://localhost:8080"
|
323 | 327 | },
|
324 | 328 | {
|
325 |
| - "id": "a2146746-181e-441b-bf5b-5f3b6fb038da", |
| 329 | + "id": "f29301eb-5f34-4e27-80ae-9b0fc72e3cf7", |
326 | 330 | "key": "auth-url",
|
327 | 331 | "value": "http://10.10.196.4:14888/auth/realms/Nexus/protocol/openid-connect/token"
|
328 | 332 | },
|
329 | 333 | {
|
330 |
| - "id": "891acf22-1874-4ed2-a7bb-8f4383460346", |
331 |
| - "key": "auth-client-secret", |
332 |
| - "value": "38a0b40e-b464-4419-9f32-3c6e9972fd68" |
333 |
| - }, |
334 |
| - { |
335 |
| - "id": "b50730b7-24ae-45f0-a7e8-c6671cc108dd", |
| 334 | + "id": "8e8e8fa0-9bf8-410e-9971-e27b6ad18060", |
336 | 335 | "key": "auth-client-id",
|
337 | 336 | "value": "clexus"
|
338 | 337 | }
|
|
0 commit comments