Jump to content

User (apikey) does not have admin access - Anything changed recently?


Recommended Posts

ginjaninja
Posted

a script, i have been using for months, which removes persons from episodes if present at series level is now failing (not sure when it started)

has something changed to stop this endpoint. working?

(line updates the item with sanitised people)

$ApiURL = $EmbyURL + "/emby/Items/$($_.id)?api_key=$EmbyApiKey"
$response = Invoke-WebRequest -Uri $ApiUrl -Method Post -Body $Body -ContentType "application/json" -WebSession $Session

powershell reports "User does not have admin access"

on 4.7.0.17

ty

ginjaninja
Posted (edited)
12 hours ago, Luke said:

Hi, server log?

 

2021-11-08 09:32:36.484 Info Server: http/1.1 GET http://192.168.4.162:8096/emby/Users/e353235f81584891a362e98fdea64373/Items/346082. UserAgent: Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.19043; en-GB) PowerShell/7.1.5
2021-11-08 09:32:36.485 Debug SqliteItemRepository: Public GetItemLinks
2021-11-08 09:32:36.486 Info Server: http/1.1 Response 200 to 192.168.4.162. Time: 2ms. http://192.168.4.162:8096/emby/Users/e353235f81584891a362e98fdea64373/Items/346082
2021-11-08 09:32:36.489 Info Server: http/1.1 POST http://192.168.4.162:8096/emby/Items/346082. UserAgent: Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.19043; en-GB) PowerShell/7.1.5
2021-11-08 09:32:36.490 Error Server: User does not have admin access.
2021-11-08 09:32:36.490 Info Server: http/1.1 Response 401 to 192.168.4.162. Time: 1ms. http://192.168.4.162:8096/emby/Items/346082

the log doesnt show but there is an api_key field/value at the end of the post url (see 1st post)

perhaps i am using some depreciated authentication method?

 

Edited by ginjaninja
pünktchen
Posted

Is your api_key a general serverwide api key or is it the access token you get from user authentication?

ginjaninja
Posted (edited)
5 hours ago, pünktchen said:

Is your api_key a general serverwide api key or is it the access token you get from user authentication?

serverwide api key (NOT from user authentication)

Edited by ginjaninja
Posted

Is it displayed in the api keys section?

ginjaninja
Posted
9 hours ago, Luke said:

Is it displayed in the api keys section?

yes it is, also created a fresh apikey just in case...same issue

ginjaninja
Posted

the issue is fixed by using an access token from user authentication....maybe something has changed with apikeys?

Posted

Just tested an apikey and it seems to be working just fine for me.

Posted

I'm having the same issue trying to get Ombi to connect. It has been working great for months but it just then stopped with the same error.

2021-11-09 20:59:54.799 Info Server: http/1.1 GET https://my.url.com/emby/users. UserAgent: Ombi/4.4.0 (https://ombi.io/)
2021-11-09 20:59:54.802 Error Server: User does not have admin access.

Emby running version=4.7.0.17 

Happy2Play
Posted (edited)

@LukeSomething changed,  as I just tested this with my update check script.

2021-11-09 13:13:06.661 Info Server: http/1.1 POST http://localhost:8096/emby/ScheduledTasks/Running/1cc2f60a05befec8b1532ac44630a00f. UserAgent: curl/7.55.1
2021-11-09 13:13:06.662 Error Server: User does not have admin access.
2021-11-09 13:13:06.662 Info Server: http/1.1 Response 401 to 127.0.0.1. Time: 2ms. http://localhost:8096/emby/ScheduledTasks/Running/1cc2f60a05befec8b1532ac44630a00f
2021-11-09 13:13:06.707 Info Server: http/1.1 POST http://localhost:8096/emby/ScheduledTasks/Running/c27fda37dfb6e39be141191aaa1c3060. UserAgent: curl/7.55.1
2021-11-09 13:13:06.708 Error Server: User does not have admin access.
2021-11-09 13:13:06.708 Info Server: http/1.1 Response 401 to 127.0.0.1. Time: 1ms. http://localhost:8096/emby/ScheduledTasks/Running/c27fda37dfb6e39be141191aaa1c3060

Is this something with the CORS update topics?  Hmm nope as changing to my HTTPS address made no difference, still get User does not have admin access.

Edited by Happy2Play
Posted
55 minutes ago, Happy2Play said:

@LukeSomething changed,  as I just tested this with my update check script.

2021-11-09 13:13:06.661 Info Server: http/1.1 POST http://localhost:8096/emby/ScheduledTasks/Running/1cc2f60a05befec8b1532ac44630a00f. UserAgent: curl/7.55.1
2021-11-09 13:13:06.662 Error Server: User does not have admin access.
2021-11-09 13:13:06.662 Info Server: http/1.1 Response 401 to 127.0.0.1. Time: 2ms. http://localhost:8096/emby/ScheduledTasks/Running/1cc2f60a05befec8b1532ac44630a00f
2021-11-09 13:13:06.707 Info Server: http/1.1 POST http://localhost:8096/emby/ScheduledTasks/Running/c27fda37dfb6e39be141191aaa1c3060. UserAgent: curl/7.55.1
2021-11-09 13:13:06.708 Error Server: User does not have admin access.
2021-11-09 13:13:06.708 Info Server: http/1.1 Response 401 to 127.0.0.1. Time: 1ms. http://localhost:8096/emby/ScheduledTasks/Running/c27fda37dfb6e39be141191aaa1c3060

Is this something with the CORS update topics?

Is the problem only with POSTs? What about GET requests? 

Happy2Play
Posted (edited)
9 minutes ago, Luke said:

Is the problem only with POSTs? What about GET requests? 

Same results

Tested in Swagger, everything works

Generated keys fail

 

Edited by Happy2Play
Posted
1 hour ago, Happy2Play said:

Same results

Tested in Swagger, everything works

Generated keys fail

 

What GET did you try?

Happy2Play
Posted
5 minutes ago, Luke said:

What GET did you try?

Works with key used in Swagger session but not with key generated via API Keys.

curl -X GET "http://localhost:8096/emby/ScheduledTasks/1cc2f60a05befec8b1532ac44630a00f?api_key={generated api key}" -H "accept: application/json" -d ""
User does not have admin access.

But looks like Swagger token even though says api_key.   Was working until expired.

curl -X GET "http://localhost:8096/emby/ScheduledTasks/1cc2f60a05befec8b1532ac44630a00f?api_key=886127b6e61841c58017c3b938bc5b3c" -H "accept: application/json" -d ""
Access token is invalid or expired.

New Swagger session key

curl -X GET "http://localhost:8096/emby/ScheduledTasks/1cc2f60a05befec8b1532ac44630a00f?api_key=6373ca94da3a451eba6be9ee6521891e" -H "accept: application/json" -d ""
{"Name":"Check for application updates","State":"Idle","Id":"1cc2f60a05befec8b1532ac44630a00f","LastExecutionResult":{"StartTimeUtc":"2021-11-09T23:18:23.6758659Z","EndTimeUtc":"2021-11-09T23:18:24.1256132Z","Status":"Completed","Name":"Check for application updates","Key":"SystemUpdateTask","Id":"1cc2f60a05befec8b1532ac44630a00f"},"Triggers":[{"Type":"StartupTrigger"},{"Type":"IntervalTrigger","IntervalTicks":36000000000}],"Description":"Downloads and installs application updates.","Category":"Application","IsHidden":true,"Key":"SystemUpdateTask"}

Can't get any generated key to work.

Note 4.6.4.0 still works so it would appear to be a Beta issue 4.7.0.17.

Posted

If you create a new api key, is there an issue with that?

Posted

Nevermind, I see the issue. Thanks.

  • Like 1
Posted

I also experienced this. Reverting to 4.7.0.15 fixed it.

Posted

@Luke Hi, any news about this problem with 4.7.0.17 ? I don't want update anymore (still stay on 4.7.0.15)

 

Ref to > 

 

Posted
4 hours ago, nunuxx said:

@Luke Hi, any news about this problem with 4.7.0.17 ? I don't want update anymore (still stay on 4.7.0.15)

 

Ref to > 

 

Yes please see my previous response. Thanks.

  • Like 1
Happy2Play
Posted

This issue appears resolved in 4.7.0.18 in my tests.

  • Agree 1
Posted
9 minutes ago, Happy2Play said:

This issue appears resolved in 4.7.0.18 in my tests.

Thanks for the feedback.

  • Thanks 1
Posted

Resolved for me also using 4.7.0.18, thanks.

  • Thanks 1

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