|
| 1 | + |
| 2 | +=== Login with a host |
| 3 | + |
| 4 | +>>> [CLI] auth login --host [DATABRICKS_URL] --profile test --use-device-code |
| 5 | +Using a browser on another device, visit: |
| 6 | +[DATABRICKS_URL]/device/verification |
| 7 | + |
| 8 | +And enter the code: |
| 9 | +WDJB-MJHT |
| 10 | + |
| 11 | +Once finished, enter the confirmation code provided in your browser. |
| 12 | +Confirmation code: Profile test was successfully saved |
| 13 | + |
| 14 | +>>> [CLI] auth token --profile test |
| 15 | +json.access_token = "oauth-token"; |
| 16 | + |
| 17 | +>>> [CLI] auth profiles |
| 18 | +Name Host Valid |
| 19 | +test (Default) [DATABRICKS_URL] YES |
| 20 | + |
| 21 | +=== Login again with the host from the saved profile |
| 22 | + |
| 23 | +>>> [CLI] auth login --profile test --use-device-code |
| 24 | +Using a browser on another device, visit: |
| 25 | +[DATABRICKS_URL]/device/verification |
| 26 | + |
| 27 | +And enter the code: |
| 28 | +WDJB-MJHT |
| 29 | + |
| 30 | +Once finished, enter the confirmation code provided in your browser. |
| 31 | +Confirmation code: Profile test was successfully saved |
| 32 | + |
| 33 | +>>> [CLI] auth token --profile test |
| 34 | +json.access_token = "oauth-token"; |
| 35 | + |
| 36 | +>>> print_requests.py --oneline //oidc/v1/device/auth //oidc/v1/token |
| 37 | +{"method": "POST", "path": "/oidc/v1/device/auth", "raw_body": "client_id=databricks-cli&scope=offline_access+all-apis"} |
| 38 | +{"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"} |
| 39 | +{"method": "POST", "path": "/oidc/v1/device/auth", "raw_body": "client_id=databricks-cli&scope=offline_access+all-apis"} |
| 40 | +{"method": "POST", "path": "/oidc/v1/token", "raw_body": "client_id=databricks-cli&confirmation_code=FTFAQQKY&device_code=device-code-2&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code"} |
| 41 | + |
| 42 | +=== Login with custom scopes |
| 43 | + |
| 44 | +>>> [CLI] auth login --host [DATABRICKS_URL] --profile scoped --use-device-code --scopes sql |
| 45 | +Using a browser on another device, visit: |
| 46 | +[DATABRICKS_URL]/device/verification |
| 47 | + |
| 48 | +And enter the code: |
| 49 | +WDJB-MJHT |
| 50 | + |
| 51 | +Once finished, enter the confirmation code provided in your browser. |
| 52 | +Confirmation code: Profile scoped was successfully saved |
| 53 | + |
| 54 | +>>> print_requests.py --oneline //oidc/v1/device/auth //oidc/v1/token |
| 55 | +{"method": "POST", "path": "/oidc/v1/device/auth", "raw_body": "client_id=databricks-cli&scope=offline_access+sql"} |
| 56 | +{"method": "POST", "path": "/oidc/v1/token", "raw_body": "client_id=databricks-cli&confirmation_code=FTFAQQKY&device_code=device-code-3&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code"} |
0 commit comments