Jump to content

Help with Authentication


aahmyu

Recommended Posts

Hello, im trying to use "postman" to try to get an access token 

im sending a post request to "Users/AuthenticateByName"

 

in the body im sending 

{
"username": "test",
"password": ""
}
 
i keep getting a response of "Invalid user or password entered."
 
 
Thanks
Link to comment
Share on other sites

What are you really trying to accomplish?

 

i.e. Why do you want to get an access token?

atm nothing really. just want to explore a bit in the api. I probably want to do something when i have time. can you tell me what im missing? i added the headers same as in the docs and still doesnt work.

and also i cant use swagger endpoints at all without the access token. so thats why i want one.

 

Thanks

Edited by aahmyu
Link to comment
Share on other sites

also i cant use swagger endpoints at all without the access token. so thats why i want one.

 

Okay, that's what I wanted to know because there are easier ways to make that work.

 

In the server there is a "Security" section where you can generate an API key that can then be used for things like swagger.

 

As for your auth call, assuming all the headers are correct, it doesn't look like you did this:

 

 

 

  • The password must be sent in the body, in three different form fields:

  • pw - password in plain text
  • password - password in Sha1
  • passwordMd5 - password in MD5

IMPORTANT - The Emby login API is in a state of transition, and this is why three different forms of the password are required. Beginning April 1, 2018, only the "pw" param will be required. Until then, all three are needed in order to support both newer and older servers.

Link to comment
Share on other sites

Okay, that's what I wanted to know because there are easier ways to make that work.

 

In the server there is a "Security" section where you can generate an API key that can then be used for things like swagger.

 

As for your auth call, assuming all the headers are correct, it doesn't look like you did this:

thanks for your reply i tried doing this. but i keep getting this "Value cannot be null.

Parameter name: appName"? im using the same headers as from the docs. 
Link to comment
Share on other sites

  • 3 weeks later...

Did you ever get this going?

 

 

Sent from my phone!

Yeah. but im not sure if its the right way to do it but it works.

 

My problems were happening because of bad headers

 

These headers worked for me:

{ 
Content-Type: application/json
X-Emby-Authorization: MediaBrowser Client="Android", Device="Samsung Galaxy SIII", DeviceId="xxx", Version="1.0.0.0"
}

And in the body you need this:

{"Password":"","PasswordMd5":"","Username":"","Pw":""}

Make sure to fill the user name and passwords if you have password for the user

 

Hope this helps

Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...
jervaise

Add that to the header.  It is missing from the doc.

I was trying in Swagger, added the appName but still getting Value cannot be null. (Parameter 'appName'). Is there something else to add?

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