koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
3.95k stars 238 forks source link

Home Assistant - Basic Auth Popup #1357

Closed gorfreed closed 4 months ago

gorfreed commented 4 months ago

I have installed the custom component for Scrypted via HACS on my HA (latest). When clicking the integration in the sidebar, I am getting a basic auth popup that doesn't accept any user/password (I tried all combinations in use for anything on the machine) which keeps me from using the platform on HA. I cannot identify what is causing this to occur, there is no popup when accessing my Scrypted install directly via its address on the server machine.

image

koush commented 4 months ago

What browser is this and do you have any extensions installed

gorfreed commented 4 months ago

It doesn't seem to be browser-related. I use Chrome, but I just verified the issue on Edge (no extensions) and on incognito tabs.

koush commented 4 months ago

Can you screenshot/paste your custom component configuration that you used to add scrypted? Is this is a standalone install, ie, not a HA add-on install, but something separate like Docker?

gorfreed commented 4 months ago

My HA is docker-based standalone, so I had to install Scrypted via docker compose. The Scrypted custom component was installed through HACS. I didnt change your customize anything and only used the UI for that.

koush commented 4 months ago

by chance did this also get resolved with the fix from your other bug report?

gorfreed commented 4 months ago

No it didnt, as the cause for the other one was simply me not reading the appropriate docs while this one I did by the book on a vanilla system. Is there any log readout from some of the systems that might be helpful?

gorfreed commented 4 months ago

Alternatively, is it possible to obtain the "Scrypted NVR Card Webpage URL" without the embedded Scrypted page on HA? Maybe ID and token can be taken from the main frontend as well? I could then simply use those to generate the code for the custom dashboard panels.

gorfreed commented 4 months ago

These errors are displayed in the Chrome console at the moment the popup is shown:

image

koush commented 4 months ago

does your HA http configuration use anything that might be intercepting 401s or basic auth? I think that's the underlying problem. Seeing the request and response headers would be useful.

koush commented 4 months ago

Alternatively, is it possible to obtain the "Scrypted NVR Card Webpage URL" without the embedded Scrypted page on HA? Maybe ID and token can be taken from the main frontend as well? I could then simply use those to generate the code for the custom dashboard panels.

that's exactly what this process does, and something is intercepting the auth.

koush commented 4 months ago

it may also be worth restarting HA or scrypted to see if that resolves it.

gorfreed commented 4 months ago

Alternatively, is it possible to obtain the "Scrypted NVR Card Webpage URL" without the embedded Scrypted page on HA? Maybe ID and token can be taken from the main frontend as well? I could then simply use those to generate the code for the custom dashboard panels.

that's exactly what this process does, and something is intercepting the auth.

What I meant is if it is possible to manually generate the URL without the Scrypted NVR HA. Maybe the required token and ID are listed elsewhere?

image

How can I generate the request headers output you need?

koush commented 4 months ago

These errors are displayed in the Chrome console at the moment the popup is shown:

image

You can inspect the network tab in the browser to see the headers for these failed requests. I'll add another week to your trial because I'd like to solve this mystery.

koush commented 4 months ago

What I meant is if it is possible to manually generate the URL without the Scrypted NVR HA. Maybe the required token and ID are listed elsewhere?

the token you see is the same token when you browse to the sidebar and get the browser login prompt. The ids are the camera ids in the url (view scrypted management console externally). If it fails there, it will fail also fail in the card. something is munging the auth in Home assistant.

gorfreed commented 4 months ago

I installed everything again from the scratch and now everything works. Who knows what has caused this. Anyways, Scrypted is now doing its thing and I successfully embedded its entities on my dashboard. Its very cool! You got a new subscriber :)

koush commented 4 months ago

@gorfreed when you say everything, does that mean you reinstalled HA as well?