Jump to content

Unable to create a user and change their password using the API.


Recommended Posts

zm098y
Posted (edited)

I created a user and changed the user's password using the Emby API. The EmbyServer management backend showed success, but I failed to log in. I can confirm that I have enabled login for this user, and I can confirm that no other strings are mixed into the password change code.

 

const createRes = await embyAdmin.post('/Users/New', { Name: embyUser });
const embyId = createRes.data.Id;

await Promise.all([
    embyAdmin.post(`/Users/${embyId}/Policy`, Policy),
    embyAdmin.post(`/Users/${embyId}/Configuration`, Configuration),
    embyAdmin.post(`/Users/${embyId}/Password`, { NewPassword: embyPass })
]);

 

if (field === 'emby_password') {
    await embyAdmin.post(`/Users/${emby_id}/Password`, { NewPassword: value });
    res.json({ msg: "Emby 密码已修改" });
}

2026-01-0918_17_41.thumb.png.07e7ac6a2433ed2e93143adaf101684f.png

Edited by zm098y
zm098y
Posted

const createRes = await embyAdmin.post('/Users/New', { Name: embyUser });
const embyId = createRes.data.Id;

await Promise.all([
    embyAdmin.post(`/Users/${embyId}/Policy`, Policy),
    embyAdmin.post(`/Users/${embyId}/Configuration`, Configuration),
    embyAdmin.post(`/Users/${embyId}/Password`, { NewPassword: embyPass })
]);

 

if (field === 'emby_password') {
    await embyAdmin.post(`/Users/${emby_id}/Password`, { NewPassword: value });
    res.json({ msg: "Emby 密码已修改" });
}


After changing the password, it was set to a blank password, which is not the password I need.

Posted

Hi, did you compare your requests to what the web app sends?

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