Skip to content

Commit b60ab4a

Browse files
committed
Update docs
1 parent 7c206ec commit b60ab4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/docs/dash/authentication/users_get_current.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ print(f"E-mail: {email}, username: {username}, user: {user}, ip: {ip}")
2020
```
2121

2222
:::info
23-
For this sample to work when running on your local machine, use the `databricks apps run-local` CLI command which injects the necessary HTTP headers.
23+
This sample requires on-behalf-of-user authentication to be enabled for your app to access the X-Forwarded-Access-Token header. Without this, you will only have access to basic user information from the headers, not the detailed information from the Databricks API. Without the user token present, w.current_user.me() will return information about the app service principal.
2424
:::
2525

2626
## Permissions

docs/docs/streamlit/authentication/users_get_current.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ st.write(f"Access token present: {'Yes' if user_access_token else 'No'}")
2828
if user_access_token:
2929
# Initialize WorkspaceClient with the user's token
3030
w = WorkspaceClient(token=user_access_token, auth_type="pat")
31-
31+
3232
# Get current user information
3333
current_user = w.current_user.me()
34-
34+
3535
# Display user information
3636
st.write(f"""
3737
User ID: {current_user.id}
@@ -44,7 +44,7 @@ if user_access_token:
4444
```
4545

4646
:::info
47-
For this sample to work when running on your local machine, use the `databricks apps run-local` CLI command which injects the necessary HTTP headers.
47+
This sample requires on-behalf-of-user authentication to be enabled for your app to access the X-Forwarded-Access-Token header. Without this, you will only have access to basic user information from the headers, not the detailed information from the Databricks API. Without the user token present, w.current_user.me() will return information about the app service principal.
4848
:::
4949

5050
## Resources

0 commit comments

Comments
 (0)