Jump to content

API key for users?


elcaron

Recommended Posts

Hallo, I want to connect Emby to my Home Assistant server to auto dim some lights base on play status. I have generated an API key in the admin controls (Advanced -> API Keys) and this works in principle. Unfortunately, home assistant now gets the activity of my admin user, which is not particularly helpful. In the interface of my normal user, I cannot find a setting to generate an API key. What am I missing?

Link to comment
Share on other sites

Hi.  The API key is for authentication.  On the specific query you are calling, if you want that scoped to a particular user, then you would provide that user ID as a part of the parameters or URL.

Link to comment
Share on other sites

Okay, where can I find the URL documentation?

Also, I find this implementation a little weird. Why would "Integrate this user's account into home assistant" be an admin task, that requires giving the Homeassistant admin an Emby admin API key? I think there should be a possibility for users to generate API keys for their accounts.

  • Agree 1
Link to comment
Share on other sites

PenkethBoy

@elcaron

you need to use the AuthenticatebyName endpoint and the returned data includes an api_key specific to the user (called an access token)

Link to comment
Share on other sites

Sure, but the controls for HA are

host string (Optional, default: localhost)
The host name or IP address of the device that is running Emby
 
api_key string Required
The API key to use to authenticate.
 
ssl boolean (Optional, default: false)
Connect with HTTPS/WSS. Your SSL certificate must be valid.
 
port integer (Optional)
The port number of the device that is running Emby.
 
So if the user selection cannot be done in the host field, I don't see how it would be possible given these methods of interaction. As I sayid, I think there SHOULD be API keys for users from the emby side, but the current state seems to require improvements on the HA plugin.
Link to comment
Share on other sites

PenkethBoy

the HA plugin needs updating/modifying not emby as you can get the api key for the user with a simple script

and probably then call HA from the script for it to connect to emby

or run the script in HA - i assume thats possible as not using HA currently although intend to in the near ish future

Link to comment
Share on other sites

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...