Skip to content

Commit

Permalink
Add request cookies to login flow context dict
Browse files Browse the repository at this point in the history
Adds cookies from the aiohttp Request object associated with the request to POST
/auth/login_flow.  This is useful if an auth provider operates on data provided
through cookies by an external system.

Example use-case:

  * Reverse proxy handles authentication ands sets a JWT in a cookie upon
    success.  HomeAssistant can allow access after validating this JWT.
  • Loading branch information
sidoh committed Sep 10, 2019
1 parent 9df5c0a commit 6914c5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/auth/login_flow.py
Expand Up @@ -177,6 +177,7 @@ async def post(self, request, data):
handler, handler,
context={ context={
"ip_address": request[KEY_REAL_IP], "ip_address": request[KEY_REAL_IP],
"cookies": request.cookies,
"credential_only": data.get("type") == "link_user", "credential_only": data.get("type") == "link_user",
}, },
) )
Expand Down

0 comments on commit 6914c5c

Please sign in to comment.