Client has not been setup with client id and client secret
Hi, I'm new to Podio and I'm trying to setup the API using PHP on my web server.
Problem is, I keep running into that "Client has not been setup with client id and client secret" error, but I can't seem to find what is wrong with my integration, there's barely 2-3 lines of code, I'm not sure what could be wrong...
My APP setting: http://jlmultimedia.net/podio/screenshot.png
My code: http://jlmultimedia.net/podio/screenshot2.png
In the error_log file:
PHP Fatal error: Uncaught exception 'Exception' with message 'Client has not been setup with client id and client secret.' in /home4/jlmultim/public_html/podio/podio-php/lib/Podio.php:139
Stack trace:
#0 /home4/jlmultim/public_html/podio/podio-php/lib/Podio.php(101): Podio::request('POST', '/oauth/token', Array, Array)
#1 /home4/jlmultim/public_html/podio/podio-php/lib/Podio.php(54): Podio::authenticate('app', Array)
#2 /home4/jlmultim/public_html/podio/test.php(16): Podio::authenticate_with_app('my-first-app-xi...', 'jAkMDpoF4TeQo9I...')
#3 {main}
thrown in /home4/jlmultim/public_html/podio/podio-php/lib/Podio.php on line 139
Anybody can help??
Thanks!
-
Hi Joel,
please take a look at the documentation for the App authentication flow, which you are using:
https://developers.podio.com/authentication/app_auth
As you can see, there are 4 things you need to supply (not 2): the
app_id
,app_token
, and theclient_id
andclient_secret
:Podio::setup(YOUR_CLIENT_ID, YOUR_CLIENT_SECRET); try { Podio::authenticate_with_app(YOUR_APP_ID, YOUR_APP_TOKEN); // Authentication was a success, now you can start making API calls. } catch (PodioError $e) { // Something went wrong. Examine $e->body['error_description'] for a description of the error. }
So what are all these things? The
client_id
andclient_secret
identify your client (in your case: your PHP-script) to Podio. Theapp_id
andapp_token
are allowing your client to access the app with the specificapp_id
. They are similar to a username / password in this way.Important: You should NEVER publish this information on the internet, because this is a security risk. You should delete the
client_id
andclient_secret
and create new once. Also, you should reset theapp_token
(in the developer menu of the app).Best,
StefandieKollaborateure.com - Podio Training+Consulting+Development English & Deutsch
-
Hi Stefan,
Thanks a lot for your help, it is very much appreciated.
So I am not sure I understand the first part of the doc about the POST request, but I tried the code you posted and still no luck:
Podio::setup("my-first-app-xii8h5", "jAkMDpoF4TeQo9I3eECVce22cctytv1AL7wkrJtcyZgVZ2niWm0AP0IO1Q7jMX41");
try {
Podio::authenticate_with_app("12842044", "575b032b397647a5a74ba06e8013a994");// Authentication was a success, now you can start making API calls.
}
catch (PodioError $e) {
// Something went wrong. Examine $e->body['error_description'] for a description of the error.
echo $e->body['error_description'];
}the error_description now contains -> Invalid value "my-first-app-xii8h5" (string): must be integer"
I don't understand why it is asking for an integer, since the client_id is alphanumeric ?? my-first-app-xii8h5 is my CLIENT_ID...?
About the security risk, don't worry this is only a test app I will delete it and create a new one after I am able to establish a Podio connection through PHP.
Thanks so much for your help :)
Please sign in to leave a comment.
Comments
5 comments