Click here to Skip to main content
13,735,023 members
Rate this:
 
Please Sign up or sign in to vote.
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 18-May-18 1:39am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.180920.1 | Last Updated 18 May 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100