Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auth Command

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
chris



Joined: 13 Jun 2012
Posts: 15

PostPosted: Fri Jan 04, 2013 9:53 am    Post subject: Auth Command Reply with quote

Hi KarlH, hello community!
happy new year Cool

I am searching the web - and this forum - for a way to geoprotect my streams in icecast. I already have a webservice to do url-authentication which is working. But given the fact that i need a high redundancy environment i would like to authenticate direct on the streamingserver (without installing a webserver on all of them).

there are a few posts talking about command-authentication (instead of url) (Example).

I am currently working with version 2.3.3 of Icecast and it does not seem to be working. Am i doing something wrong or is it not included in 2.3.3.

thanks for your time!
chris


Edit:
I installed KH-branch to already try it out, no matter if it will / would work in non-kh or not.
Unfortuanetly, it does not work yet. What is icecast expecting, a return-code 0 as described in auth_cmd.c
Code:
a return code of 0 indicates a valid user, authentication failure if otherwise
or a print-value as described by user als (see link above). actually i tried both but it does not work. script is executed, but im unable to connect to the mountpoint..
Back to top
View user's profile Send private message Send e-mail
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sat Jan 05, 2013 9:35 am    Post subject: Reply with quote

I ended up making the command auth operate in a similar way to url auth, details are passed one line at a time like IP and responses are returned like icecast-auth-user: 1, icecast reads and process those returned lines like header lines in url auth and control the client in the same way

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris



Joined: 13 Jun 2012
Posts: 15

PostPosted: Tue Jan 08, 2013 2:32 pm    Post subject: Reply with quote

Thanks for your reply, karl.
Do you have an example at hand which you could provide me? My very basic perl-script only does the following:
Code:
#!/usr/bin/perl
$txt="icecast-auth-user: 1
icecast-auth-message: test\n";
print $txt;
exit 0;


and the mountpoint-setting looks like this:
Code:
<mount>
  <mount-name>/m/station/mp3_128</mount-name>
  <fallback-override>1</fallback-override>
  <max-listener-duration>68400</max-listener-duration>
  <authentication type="command">
  <option name="listener_add" value="/etc/geoip.pl"/>
  </authentication>
</mount>


but it does not work. i think i tried everything Rolling Eyes

thanks a lot!
chris
Back to top
View user's profile Send private message Send e-mail
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Jan 09, 2013 3:20 am    Post subject: Reply with quote

When I try the command auth here I see the following

..various auth lines
[2013-01-09 16:14:01] DBUG auth_cmd/auth_cmd_client Waiting on pid 2084
[2013-01-09 16:14:01] DBUG auth/auth_new_listener listener connection failed

the reason for the failure was because there was no empty blank line
at the end of the headers, as soon as the added another \n then it worked
as intended. If you do not get that then you need to send me the log lines
at level 4 with the command auth.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris



Joined: 13 Jun 2012
Posts: 15

PostPosted: Wed Jan 09, 2013 7:30 am    Post subject: Reply with quote

Thank you Karl, that was very helpful. I tried everything except having two \n's Smile

Have a nice day!
Chris
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber