INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: authentication and SetInfo in web interface  (Read 2482 times)

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
authentication and SetInfo in web interface
« on: March 11, 2011, 11:44:12 am »

Hi,

I love the new web interface. It is powerful and easy to use. The examples are nice but documentation is missing, or I don't know where it is. In particular, I am trying to figure how to use an authetication token in a SetInfo query to chance the database. Also, is there a way to create new playlists, or replacing the old ones? That would be an awesome addition. There many small programs I want to write in my stack.



Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: authentication and SetInfo in web interface
« Reply #1 on: March 11, 2011, 12:05:49 pm »

Hi,

I love the new web interface. It is powerful and easy to use. The examples are nice but documentation is missing, or I don't know where it is. In particular, I am trying to figure how to use an authetication token in a SetInfo query to chance the database. Also, is there a way to create new playlists, or replacing the old ones? That would be an awesome addition. There many small programs I want to write in my stack.

To handle authentication, do this:

1) Test to see if a server is available using the 'Alive' function (this call does not require authentication).

2) Call 'Authenticate' on the server.  This will use the standard HTTP password system (401 Authorization Required response, followed by new request including a password) and return a token.

3) Include &Token=[insert token here] on all subsequent calls.  Without the token, the server will require the same 401 / resubmit handshake as #2.
Logged
Matt Ashland, JRiver Media Center

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
Re: authentication and SetInfo in web interface
« Reply #2 on: March 11, 2011, 01:41:31 pm »

Thanks Matt. It worked! Awesome.

What is the life span of the tokens?

Also, what about the second part of my question. Are you planning ability to change change playlists (add playlist, add item, delete playlists)? Given that you already provide read access, you might be very closing doing that.

The possibilities this would open up is endless. Basically, it would provide me to generate playlists with an external program. Similar to smartlists, but much more powerful; The catch phrase is, algorithmic smart lists in any programming language. For example, I would be able to write my own intelligent radio program (say customized for tango DJing). A particular application I am thinking is a small program that go over all (or a selection of) playlists and replace all stacked items with the top of the stack (I need to do that manually very often).


Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: authentication and SetInfo in web interface
« Reply #3 on: March 11, 2011, 02:04:30 pm »

What is the life span of the tokens?

They expire after two hours of inactivity.


Quote
Also, what about the second part of my question. Are you planning ability to change change playlists (add playlist, add item, delete playlists)? Given that you already provide read access, you might be very closing doing that.

The possibilities this would open up is endless. Basically, it would provide me to generate playlists with an external program. Similar to smartlists, but much more powerful; The catch phrase is, algorithmic smart lists in any programming language. For example, I would be able to write my own intelligent radio program (say customized for tango DJing). A particular application I am thinking is a small program that go over all (or a selection of) playlists and replace all stacked items with the top of the stack (I need to do that manually very often).

You could write an MPL playlist now and import / play it.

But I agree it would be nice to add playlist management functionality to MCWS.



[/quote]
Logged
Matt Ashland, JRiver Media Center

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
Re: authentication and SetInfo in web interface
« Reply #4 on: March 11, 2011, 03:10:03 pm »

Thanks
You could write an MPL playlist now and import / play it.

Yes, that is what i am planning to do in the short-term. Unfortunately, import playlists do not keep the hierarchical structure of playlists and new playlists would not work nice with previous playlists etc.


You could write an MPL playlist now and import / play it.

But I agree it would be nice to add playlist management functionality to MCWS.


I am crossing my fingers.
Logged
Pages: [1]   Go Up