-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Any request with the Android SDK responds with "unauthorized" #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is your |
With my configuration, do you mean the // Example express application adding the parse-server module to expose Parse
// compatible API routes.
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || '' //Add your master key here. Keep it secret!
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey
var app = express();
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site.');
});
var port = process.env.PORT || 1337;
app.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
}); This is the log when I execute
And this the log from the
And about the error messages, the only info I see is the Thanks! |
Set clientKey to null...unless you've defined one in the Nose server you shouldn't supply one. |
@rogerhu do you mean the clientKey on the SDK initialisation? I tried that and I get the same error... |
I ran into your same issue and I found out that it was that serverURL was not set on index.js. The latest parse-server-example now includes it so just to pull that config and redeploy and try again! |
The latest parse server update fails instead of giving the unauthorized error if serverurl is not set so unless you are running an old version that is probably not the issue. I saw that it reports a 403 status code, could you double check that the appid and master key is correctly set on both client and server? |
It works!! As @simonbengtsson said, the problem was that I was using the old applicationId from Parse.com. When changing to the APP_ID from Heroku it worked perfectly! |
Glad it was an easy fix! |
I am always getting "unauthorized" when I try to perform any operation with the Android SDK.
I followed the migration guide and deployed the parse-server to Heroku and MongoLab
The server seems to be up and running. Here the last logs:

I am using the last Android SDK library:
compile 'com.parse:parse-android:1.13.0'
and initialising Parse on the app with:
Thanks for your support!
The text was updated successfully, but these errors were encountered: