|
| 1 | + |
| 2 | +=== Device code login is disabled by default |
| 3 | + |
| 4 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code |
| 5 | +Error: --use-device-code is experimental. Set DATABRICKS_CLI_DEVICE_CODE=true to enable it |
| 6 | + |
| 7 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 8 | +Error: --use-device-code is experimental. Set DATABRICKS_CLI_DEVICE_CODE=true to enable it |
| 9 | + |
| 10 | +=== Flags the non-interactive login cannot honor |
| 11 | + |
| 12 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --configure-cluster |
| 13 | +Error: --configure-cluster is not supported by the non-interactive device code login. Set cluster_id on the profile after the login |
| 14 | + |
| 15 | +=== Missing host |
| 16 | + |
| 17 | +>>> musterr [CLI] auth login --use-device-code |
| 18 | +Error: --use-device-code requires a workspace host. Pass it as an argument or with --host |
| 19 | + |
| 20 | +>>> musterr [CLI] auth login --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 21 | +Error: --use-device-code requires a workspace host. Pass it as an argument or with --host |
| 22 | + |
| 23 | +=== Incomplete flags of the second step |
| 24 | + |
| 25 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --confirmation-code FTFA-QQKY |
| 26 | +Error: --confirmation-code requires --user-code |
| 27 | + |
| 28 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT |
| 29 | +Error: --user-code requires --confirmation-code |
| 30 | + |
| 31 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 32 | +Error: --confirmation-code requires --use-device-code |
| 33 | + |
| 34 | +=== Account host |
| 35 | + |
| 36 | +>>> musterr [CLI] auth login --host https://accounts.cloud.databricks.test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 37 | +Warn: [hostmetadata] failed to fetch host metadata for https://accounts.cloud.databricks.test, will skip for 1m0s |
| 38 | +Error: --use-device-code is only supported for workspace hosts |
| 39 | + |
| 40 | +=== Profile scoped to resources |
| 41 | + |
| 42 | +>>> musterr [CLI] auth login --profile resources --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 43 | +Error: --use-device-code cannot be used with profile resources because its login is scoped to resources. Log in without --use-device-code |
| 44 | + |
| 45 | +=== No pending login |
| 46 | + |
| 47 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 48 | +Error: no pending device code login for profile test. Start a new login with: databricks auth login --host '[DATABRICKS_URL]' --profile 'test' --use-device-code |
| 49 | + |
| 50 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 51 | +Error: no pending device code login for host [DATABRICKS_URL]. Start a new login with: databricks auth login --host '[DATABRICKS_URL]' --use-device-code |
| 52 | + |
| 53 | +>>> [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code |
| 54 | + |
| 55 | +=== Wrong confirmation code |
| 56 | + |
| 57 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code AAAA-AAAA |
| 58 | +Error: token exchange: Invalid confirmation code (error code: invalid_request). Check the confirmation code and approve the login if you haven't, then rerun this command. If it still fails, start a new login with: databricks auth login --host '[DATABRICKS_URL]' --profile 'test' --use-device-code |
| 59 | + |
| 60 | +=== Rerun with the right confirmation code |
| 61 | + |
| 62 | +>>> [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code wdjb-mjht --confirmation-code ftfa-qqky |
| 63 | +Profile test was successfully saved |
| 64 | + |
| 65 | +=== Rerun after the login was completed |
| 66 | + |
| 67 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 68 | +Error: no pending device code login for profile test. Start a new login with: databricks auth login --host '[DATABRICKS_URL]' --profile 'test' --use-device-code |
| 69 | + |
| 70 | +=== Device code unknown to the server |
| 71 | + |
| 72 | +>>> [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code |
| 73 | + |
| 74 | +>>> update_file.py home/.databricks/token-cache.json device-code-2 unknown-device-code |
| 75 | + |
| 76 | +>>> musterr [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code --user-code WDJB-MJHT --confirmation-code FTFA-QQKY |
| 77 | +Error: token exchange: Invalid device code (error code: invalid_request). Start a new login with: databricks auth login --host '[DATABRICKS_URL]' --profile 'test' --use-device-code |
| 78 | + |
| 79 | +>>> cache_keys |
| 80 | +[ |
| 81 | + "[DATABRICKS_URL]", |
| 82 | + "test" |
| 83 | +] |
| 84 | + |
| 85 | +>>> print_requests.py --oneline //oidc/v1/device/auth //oidc/v1/token |
| 86 | +{"method": "POST", "path": "/oidc/v1/device/auth", "raw_body": "client_id=databricks-cli&scope=offline_access+all-apis"} |
| 87 | +{"method": "POST", "path": "/oidc/v1/token", "raw_body": "client_id=databricks-cli&confirmation_code=AAAAAAAA&device_code=device-code-1&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code"} |
| 88 | +{"method": "POST", "path": "/oidc/v1/token", "raw_body": "client_id=databricks-cli&confirmation_code=FTFAQQKY&device_code=device-code-1&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code"} |
| 89 | +{"method": "POST", "path": "/oidc/v1/device/auth", "raw_body": "client_id=databricks-cli&scope=offline_access+all-apis"} |
| 90 | +{"method": "POST", "path": "/oidc/v1/token", "raw_body": "client_id=databricks-cli&confirmation_code=FTFAQQKY&device_code=unknown-device-code&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code"} |
0 commit comments