security - SoundCloud app and client_id parameter with PHP -


i've come across open source project on github, soundcloud-profile-backup, user has developed web page php code:

require 'secure.php'; //create secure.php , set variable $client_id client_id 

the $client_id variable subsequently used (but never set explicitly in web page, can see) parameter of \resolve resource in soundcloud http api.

here's fragment of line it's used:

http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/$username&client_id=$client_id 

since i'm not familiar php , soundcloud app development, questions are:

  • the project open source, there's no secure.php available, assume it's somehow part of php , not created ad-hoc. what's secure.php then?
  • what's $client_id variable exactly? kind of php built-in variable set whenever secure.php included, hinted comment?

require 'secure.php'; , $client_id variable used in app (we spoke on software recommendations) , has nothing soundcloud or php.

basically, idea behind file secure.php , $client_id have credentials soundcloud's api in single file. file in .gitignore file not sent off github. way have script public , credentials private.

for information on require '';, check out require function on php.org. basically, makes sure file given in parameters loads , if doesn't, script errors out.

the $client_id 32 character id given soundcloud's developer app dashboard.

again, soundcloud , php have nothing secure.php or $client_id - used in app.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -