403 Full Authentication is required to access this resource while accessing Google Cloud middle ware endpoint

0 views
Skip to first unread message

kirti Hudda via StackOverflow

unread,
Jan 13, 2017, 11:24:04 AM1/13/17
to google-appengin...@googlegroups.com

I am getting exception while trying to access Google Cloud middleware endpoint with credential.

I am building object like:

        HttpTransport httpTransport = AndroidHttp.newCompatibleTransport();
             JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
             Sample.Builder builder = new Sample.Builder(httpTransport,
                     jsonFactory, googleAccountCredential).setHttpRequestInitializer(new HttpRequestInitializer() {
                 @Override
                 public void initialize(HttpRequest request) throws IOException {
                     googleAccountCredential.initialize(request);

                    request.setHeaders(new HttpHeaders().set("Bearer_token","token"));
                     request.setConnectTimeout(50000);
                     request.setReadTimeout(50000);
                 }
             })
                     .setApplicationName("Sample")
                     .setRootUrl("https://" + "url");




             employeeAndAssets = builder.build();       

Exception is:

{
       "code" : 403,
       "errors" : [ {
         "domain" : "global",
         "message" : "Full authentication is required to access this      resource",
         "reason" : "forbidden"
       } ],
       "message" : "Full authentication is required to access this resource"
     }


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/41636219/403-full-authentication-is-required-to-access-this-resource-while-accessing-goog
Reply all
Reply to author
Forward
0 new messages