Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to implement a Parser project that sends objects to the Parse server hosted in the cloud on Amazon Ec2. For some reason i receive an unauthorized message although i made sure several time the credentials

 I/Parse Result: Failedcom.parse.ParseRequest$ParseRequestException: unauthorized


What I have tried:

here is the traffic monitor

    root@ip-172-31-22-57:~# tcpdump -i eth0 | grep parse
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    07:40:08.015443 IP no-mans-land.m247.com.43317 > ip-172-31-22-57.eu-west-2.compute.internal.http: Flags [P.], seq 1:267, ack 1, win 229, options [nop,nop,TS val 672395363 ecr 271581], length 266: HTTP: POST /parse/classes/ExampleObject HTTP/1.1
    07:40:08.046891 IP no-mans-land.m247.com.53857 > ip-172-31-22-57.eu-west-2.compute.internal.http: Flags [P.], seq 1:262, ack 1, win 229, options [nop,nop,TS val 672395371 ecr 271588], length 261: HTTP: POST /parse/events/AppOpened HTTP/1.1

---
        appName: "My Bitnami Parse API",
        appId: "6b31005b8030af6eff84addbc00afa3ba06abe4d",
        masterKey: "e85a29a6337d16e8abda97f8e0e9220248c127d5",
        fileKey: "0bcad49154fb469a7e08d5290a699b4b4618368c",
        production: true,
        serverURL: "http://35.177.127.127:80/parse"

---

    public class MainActivity extends AppCompatActivity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ParseAnalytics.trackAppOpenedInBackground(getIntent());
      }
    }

---
    public class StarterApplication extends Application {
      @Override
      public void onCreate() {
        super.onCreate();
        // Enable Local Datastore.
        Parse.enableLocalDatastore(this);
        // Add your initialization code here
        Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
                .applicationId("6b31005b8030af6eff84addbc00afa3ba06abe4d")
                .clientKey("e85a29a6337d16e8abda97f8e0e9220248c127d5")
                .server("http://35.177.127.127:80/parse/")
                .build()
        );
        ParseObject object = new ParseObject("ExampleObject");
        object.put("myNumber", "123456");
        object.put("myString", "Alex");
        object.saveInBackground(new SaveCallback () {
          @Override
          public void done(ParseException ex) {
            if (ex == null) {
              Log.i("Parse Result", "Successful!");
            } else {
              Log.i("Parse Result", "Failed" + ex.toString());
            }
          }
        });
        ParseUser.enableAutomaticUser();
        ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);
        ParseACL.setDefaultACL(defaultACL, true);
      }
    }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900