INTERACT FORUM
More => Old Versions => JRiver Media Center 22 for Windows => Topic started by: AndrewFG on July 28, 2016, 10:51:04 am
-
I just converted my operational HTPC from v21 to v22 and I notice that some the MCWS commands (sleep PC, restart PC) don't work any more; I am using the exact same MCWS syntax as before (URLs saved as a shortcut). Did you change anything here?
-
Do you have an example of a command you're using?
-
Some commands enforce authentication now, mostly things that can mess with the system, like shutdown etc.
-
Some commands enforce authentication now, mostly things that can mess with the system, like shutdown etc.
That would be it. But can you please explain how this authentication is supposed to be done?
-
That would be it. But can you please explain how this authentication is supposed to be done?
unless it's changed, it's like http://yabb.jriver.com/interact/index.php?topic=104271.0
either basic auth or a token
-
I have the URL below in my (Safari) browser favorites; until now, opening this favorite was sufficient to send my MC HTPC to sleep; but now it doesn't work. So what do I need to add to this URL to make it work again?
http://192.168.1.103:52199/MCWS/v1/Control/MCC?Command=27001&Parameter=1
-
I've done it like this https://github.com/3ll3d00d/jrmc-utils/blob/master/functions.sh
# Obtains an authentication token if one does not exist already
function authenticate {
ensure_jrmc_alive
if [ -z "${MCWS_AUTH_TOKEN}" ]
then
export MCWS_AUTH_TOKEN="$(curl -s -u ${JRMC_USER}:${JRMC_PASS} http://${JRMC_HOST}:${JRMC_PORT}/MCWS/v1/Authenticate | xmllint --xpath '/Response[@Status="OK"]/Item[@Name="Token"]/text()' - 2>/dev/null)"
return $?
else
return 0
fi
}
which you use by appending &Token=${MCWS_AUTH_TOKEN}
to the request
if would be nice if there were a simpler way to get a token rather than having to parse XML
how to supply http basic auth details probably depends on how you are calling it, curl is something like curl -u me:password123 http://foo.com for example
-
I am not using code to call this function. And I do not want to use code for it. I just navigate to the http URL (stored in the browser favorites folder) via the regular stock Safari browser on my iPad. On MC 21 it worked just fine. But MC 22 has broken it..
-
I am not using code to call this function. And I do not want to use code for it. I just navigate to the http URL (stored in the browser favorites folder) via the regular stock Safari browser on my iPad. On MC 21 it worked just fine. But MC 22 has broken it..
it should challenge you for a username and password then, some browsers let you do http://username:password@myjriverinstance/some/path but I don't know if safari is one of them
-
You probably need to enable Authentication in the Media Network settings for those commands to be accessible again, which then means all interaction needs authentication. We decided a command to shutdown your system is best only available with credentials.
Its the same way with any action that writes to the library - you need to turn on Authentication or they fail.
-
You probably need to enable Authentication in the Media Network settings for those commands to be accessible again, which then means all interaction needs authentication.
Ok I will try that.
But what do you mean by "all interaction needs authentication"? Will I now have problems using the remotes (JRemote or Gizmo) that I have on every tablet and phone in the house?
-
But what do you mean by "all interaction needs authentication"? Will I now have problems using the remotes (JRemote or Gizmo) that I have on every tablet and phone in the house?
They'll need to be told the credentials as well.
-
Ok. I turned on credentials on the MC server options and it now works again.
Just for info: I notice that you also added the commands to Sleep, and ShutDown the MC server on your new "Panel" page; and these commands seem to work just fine without authentication. So you need to be consistent here I think..
-
Just for info: I notice that you also added the commands to Sleep, and ShutDown the MC server on your new "Panel" page; and these commands seem to work just fine without authentication. So you need to be consistent here I think..
Panel doesn't do anything but call MCWS.
-
Ok. Just for the avoidance of doubt: When I navigate to the hard wired MCWS link to shut down the PC, the browser pops up a password login screen the first time the link is used. And so I assumed that when I press the shutdown button in Panel, it would also pop up a login screen. But it didn't. Is that because the Panel shutdown button is the same URL as the hard wired MCWS link, and so the credentials had already been cached in the browser for that URL?
-
If you authorized once then your browser probably keeps sending it to any follow up requests.