From 47ed55f2167ca4a161d135b4898bc28e87893657 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 1 Feb 2022 03:04:36 -0800 Subject: [PATCH] Update async sign path docs (#1203) * Update async sign path docs * Fix typo Co-authored-by: Martin Hjelmare --- docs/auth_api.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/auth_api.md b/docs/auth_api.md index dd27b237..ef762484 100644 --- a/docs/auth_api.md +++ b/docs/auth_api.md @@ -234,7 +234,11 @@ Sometimes you want a user to make a GET request to Home Assistant to download da A signed path is a normal path on our server, like `/api/states`, but with an attached secure authentication signature. The user is able to navigate to this path and will be authorized as the access token that created the signed path. Signed paths can be created via the websocket connection and are meant to be shortlived. The default expiration is 30 seconds. -To get a signed path, send the following command: +There are two ways to get a signed path. + +If you are creating an integration, import `async_sign_path` from `homeassistant.components.http.auth`. The method will automatically adopt a refresh token if called from inside the context of an HTTP request or a WebSocket connection. If neither available (ie because inside an automation), it will use a special "Home Assistant Content" user. + +If you're working with the frontend, you can create a signed path using the following WebSocket command: ```js {