Search the Community
Showing results for tags 'form'.
-
Hi! I'm trying to create a webform where you can create an account and login into Emby without having to login in 'https://domain.com/web/index.html#!/startup/login.html?serverId=123'. I've noticed that when you authenticate a user, this user stays authenticated throughout the entire browser. So I thought if I did a '/Users/AuthenticateByName' call in the form, this would would authenticate the user like it would when you normally login but it doesn't. So basically I call '/Users/AuthenticateByName' with my desired username and password I want to login, this does the job but when I go to the same url as provided in the api call, it still asks me to login. Both in the same browser. My code to authenticate the user: function userAuthenticate($username,$password) { $dataArray = array("Username"=>$username, "Pw"=>$password); $dataString = http_build_query($dataArray); $url= 'https://domain.com/emby/Users/AuthenticateByName?api_key=123456789&'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $responseDecoded = json_decode($response,true); echo $responseDecoded["AccessToken"]; } The code above does always succeed but doesn't do what I want (that is authenticating the user in https://domain.com/web). Now I'm wondering if it is possible to accomplish what I just described. Thanks in advance! (I'm sorry if I didn't describe my problem very well, I didn't really know how to ) Greetings!