Invalid App ID

nate
@nate
9 years ago
917 posts
I went threw this months ago setting up this app to work with proxima. Just recently I did and install that went flawless. This current user's site isn;t secure could that be the problem?

Quote:
11-12 12:43:51.312 14085-14085/com.kideso.msone.app I/GCMMain: http://www.kideso.co.uk/media/api/user?password=qqqqqq&user_email=nate@demo.com
11-12 12:43:52.488 14085-14085/com.kideso.msone.app I/GCMMain: {"code":401,"text":"Unauthorized","note":"invalid application key"}

This is how it's coded
String credentials = ClientMap.PROXIMA_CLIENT_KEY + ":" + ClientMap.PROXIMA_CLIENT_KEY;
        String base64EncodedCredentials = Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP);
        request.addHeader("Authorization", "Basic " + base64EncodedCredentials);

updated by @nate: 01/04/16 12:52:38PM
brian
@brian
9 years ago
10,148 posts
Double check the credentials - this invalid application key errors means the AUTH_USER or AUTH_PASSWD is empty - so double check that ClientMap.PROXIMA_CLIENT_KEY actually contains the client key.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
When I switch the key and test on my own dev (brand new jamroom install) everything works fine. I've tried deleting and creating a new app with a new key and the same response happens.
brian
@brian
9 years ago
10,148 posts
Natedogg265:
When I switch the key and test on my own dev (brand new jamroom install) everything works fine. I've tried deleting and creating a new app with a new key and the same response happens.

It could be their web server/PHP then that's a pretty "simple" error and comes from the jrProximaCore_get_credentials() function which looks for HTTP Basic Auth username/password. If they are NOT running under SSL make sure the Require SSL option is NOT checked in the Proxima Core.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
brian:
If they are NOT running under SSL make sure the Require SSL option is NOT checked in the Proxima Core.

Yeah I already checked that. Tried it both ways just to see if I got something different.
updated by @nate: 11/12/15 03:32:19PM
brian
@brian
9 years ago
10,148 posts
You'll want to put some fdebug() calls inside the jrProximaCore_get_credentials() function (in the jrProximaCore/include.php file) and see what the contents of $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
ok I'll try that.
nate
@nate
9 years ago
917 posts
Both empty.
Quote:
(2015-11-12T23:46:39+00:00.0.93799700 : 0)-(mem: 23592960)-(pid: 2679)-(ip: 24.217.237.252)-(uri: www.kideso.co.uk/media/api/user?password=qqqqqq&user_email=nate@demo.com) |user: |

(2015-11-12T23:46:39+00:00.0.94174600 : 0.004)-(mem: 23592960)-(pid: 2679)-(ip: 24.217.237.252)-(uri: www.kideso.co.uk/media/api/user?password=qqqqqq&user_email=nate@demo.com) |pw: |

updated by @nate: 11/12/15 03:51:57PM
brian
@brian
9 years ago
10,148 posts
Natedogg265:
Both empty.

Then it's not coming as Basic Authentication OR PHP/Apache on the server isn't setting it up for you in PHP. I've not seen that before so I don't know what to recommend.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
9 years ago
10,148 posts
try doing:

fdebug($_SERVER)

See if it is anywhere in the keys.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
Since it does authenticate everywhere else I install this, I have to conclude it's a server issue.
nate
@nate
9 years ago
917 posts
brian:
try doing:

fdebug($_SERVER)

See if it is anywhere in the keys.

I'll try that.
brian
@brian
9 years ago
10,148 posts
Natedogg265:
Since it does authenticate everywhere else I install this, I have to conclude it's a server issue.

Yeah I'm going to agree...


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
9 years ago
10,148 posts
If you're setting this up for a customer, you could have them try it for free on our hosting:

https://www.jamroom.net/hosting

That way you can see if it is a server issue.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
Quote:
(2015-11-13T00:01:45+00:00.0.64460900 : 0)-(mem: 23592960)-(pid: 11670)-(ip: 24.217.237.252)-(uri: www.kideso.co.uk/media/api/user?password=qqqqqq&user_email=nate@demo.com)
Array (
[PATH] => /usr/local/bin:/usr/bin:/bin
[REDIRECT_STATUS] => 200 [UNIQUE_ID] => VkUoaX8AAAEAABd7pSIAAAAH
[SCRIPT_URL] => /media/api/user
[SCRIPT_URI] => http://www.kideso.co.uk/media/api/user
[CONTENT_LENGTH] => 0
[HTTP_HOST] => www.kideso.co.uk
[HTTP_USER_AGENT] => AndroidAgent
[HTTP_CONNECTION] => close
[SERVER_SIGNATURE] => Apache/2.4.16 (Unix) Server at www.kideso.co.uk Port 80
[SERVER_SOFTWARE] => Apache/2.4.16 (Unix)
[SERVER_NAME] => www.kideso.co.uk
[SERVER_ADDR] => 10.0.187.65
[SERVER_PORT] => 80
[REMOTE_ADDR] => 24.217.237.252
[DOCUMENT_ROOT] => /home/sites/kideso.co.uk/public_html
[REQUEST_SCHEME] => http
[CONTEXT_PREFIX] =>
[CONTEXT_DOCUMENT_ROOT] => /home/sites/kideso.co.uk/public_html
[SERVER_ADMIN] => root@localhost
[SCRIPT_FILENAME] => /home/sites/kideso.co.uk/public_html/media/modules/jrCore/router.php
[REMOTE_PORT] => 39488
[REDIRECT_QUERY_STRING] => _uri=api/user
[REDIRECT_URL] => /media/api/user
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => POST
[QUERY_STRING] => _uri=api/user
[REQUEST_URI] => /media/api/user?password=qqqqqq&user_email=nate@demo.com
[SCRIPT_NAME] => /media/modules/jrCore/router.php
[PHP_SELF] => /media/modules/jrCore/router.php
[REQUEST_TIME] => 1447372905 [jr_is_ajax_request] => 1 )
brian
@brian
9 years ago
10,148 posts
Yeah that is all normal stuff - no basic auth in there though, so something is wrong. On the server try this:

a2enmod auth_basic

then restart Apache:

service apache2 restart

That's on Ubuntu - change the restart command to whatever for the OS.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
9 years ago
917 posts
I don't have that kind of access. Thanks. I'll recommend the free hosting.

Tags