简体   繁体   中英

How to obtain APP_ID and CLIENT_KEY for Parse server hosted on a EC2 of AWS

I am really new to AWS and EC2 , and I am trying to hook my Android project with my new Parse server hosted on my EC2 instance but in order to initialize my server in my project, I need my APP_ID and CLIENT_KEY which for some silly reason I cannot find them.

Here is what I have done till now:

  • I am Not using a Java SSH Client since It doesn't working! Instead I am using the alternative which is a standalone SSH client
  • Connected to bitnami parse server via my terminal (Mac), with success.

  • I obtained my username and password and I have access to my Parse dashboard.

Most suggestions I came across, where giving solutions based on a Java SSH client via Browser connection, but like I said, I am using the Standalone one. So how do I obtain it??

Here is my code:

 Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())

        //where do I Find my APP_ID
        .applicationId("myappid")

        //where do I Find my CLIENT_KEY
        .clientKey(null)

        .server("http://ec2-xx-xxx-xxx-xx.us-east-2.compute.amazonaws.com/parse/")
        .build()
);


ParseObject object = new ParseObject("ExampleObject");
object.put("myNumber", "123");
object.put("myString", "rob");

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());
    }
  }
});

Turnes out all I had to do was to open the server.js file on the Bitnami parse server running in my terminal. And that's achieved by doing the following (In the Bitnami parse server in Terminal):

cd /opt/bitnami/apps/parse/htdocs/ 

and then:

vi server.js

This problem usually occurs while using putty in Windows 10, so if you want to open the server.js file in the terminal, you have to run the following commands:

cd stack/parse
cat config.json

And if you want to know your username and password for logging in Parse Dashboard, you have to run the following command:

cat /home/bitnami/bitnami_credentials

Here is the link where you can check all the commands that are mentioned above int the console:

just run this below command

ssh -i <your pem file with path> <your public DNS>

for example

sudo ssh -i "Downloads/karthi.pem" ubuntu@ec2-1821-434-234-5130.us-east-2.compute.amazonaws.com

I too faced the same problem while using PuTTY on my Windows 10. Then I posted this issue on Udemy platform of my course. There Rob (Tutor of course) replied with the following way.

cd stack/parse

cat config.json

Hope this works for you too. the following link is the code how it worked for me. Check it if you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM