Hi All,

able to write data in firebase databse and Getting an error when read data 
from Servlet:

Code to Read

public HttpResponse firebaseGet(String path) throws IOException {
    // Make requests auth'ed using Application Default Credentials
    Credential credential = 
GoogleCredential.getApplicationDefault().createScoped(FIREBASE_SCOPES);
    HttpRequestFactory requestFactory = 
httpTransport.createRequestFactory(credential);

    GenericUrl url = new GenericUrl(firebaseDbUrl+path);

    return requestFactory.buildGetRequest(url).execute();
}


Output:

[s~taxideals20/20180402t002617.408725620079372773].<stdout>: ERROR 
com.google.api.client.http.HttpResponseException: 401 <h1>Unauthorized</h1> 
<h2>Error 401</h2>

sample
https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/firebase-tictactoe

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/ceaf178c-dcf5-4322-a248-f143453659fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine... hr lumiins

Reply via email to