Jump to content

Recommended Posts

Hars084
Posted

Hi everyone,

 

I’m working on a Stremio addon (StreamBridge) that connects to Emby and authenticates using /Users/AuthenticateByName. It works for most users, but a few get 401 errors even with correct credentials.

 

The addon has a config page where users enter server URL, username, and password, and it calls the API to fetch the user ID and access token. It works fine for some, but fails for others. Some are not even able to get access token and for some it keeps on expiring.

 

Here’s the JS snippet I use to het userID and access token for further requests to server:

const res = await fetch(`${url}/Users/AuthenticateByName`, {

  method: "POST",

  headers: {

    "Content-Type": "application/json",

    "X-Emby-Authorization": 'MediaBrowser Client="StreamBridge", Device="WebHelper", DeviceId="webhelper", Version="1.0.0"'

  },

  body: JSON.stringify({ Username: user, Pw: pass })

});

const data = await res.json();

if (!res.ok) throw Error(data.Message || "Auth failed");

Anyone seen this before? Could it be something with Emby config, server version, or security settings?

 

Here’s the repo if you want to take a look: https://github.com/h4harsimran/streambridge

 

Thanks!

Posted

Hi, that looks like. Have you personally reproduced the problem, or are you just taking their word for it that they've entered the correct credentials?

Hars084
Posted (edited)

I have not been able to reproduce myself. Its working fine for me but I am just getting that feedback from people over internet. My first thought was also that they are not writing right username, password or server URL. But some were able to get useID and access token but nothing was showing in their stream. I checked logs of my addon server and it mentioned token expired.

Edited by Hars084
Posted
35 minutes ago, Hars084 said:

I have not been able to reproduce myself. Its working fine for me but I am just getting that feedback from people over internet. My first thought was also that they are not writing right username, password or server URL. But some were able to get useID and access token but nothing was showing in their stream. I checked logs of my addon server and it mentioned token expired.

It could be any number of things besides just incorrect login.

For example, it looks like you're expecting local server credentials. Maybe they're confusing the difference with Emby Connect and entering Emby Connect credentials into your UI.

Or maybe they restricted device access and forgot about it, or remote access. The server log will usually have the answer.

  • Thanks 1
  • 2 weeks later...
Ratatouille
Posted

Where can I get this addon?

 

Hars084
Posted

You can use this link StreamBridge or link on my github repository mentioned in original post.

Ratatouille
Posted

Thank you, but  got error  NetworkError when attempting to fetch resource.
on another browser got ❌ Failed to fetch?

the curl cmd got me 

Value cannot be null. (Parameter 'name')-bash: -H: command not found
-bash: -H: command not found
-bash: -d: command not found

 

Ratatouille
Posted (edited)

Well I was able to make it work by using my proxy address https://emby.xxxxxxx.duckdns.org instead of http://http://192.168.50.50:8096😅

Edited by Ratatouille
Hars084
Posted

Glad it worked out. Looks like emby server need to behind https:// to get user access tokens. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...