javascript - How to communicate between servers (Google Cloud Engine -> Google App Engine) using oAuth2 -
first describe how our system looks like. have 2 servers.
the first 1 on google app engine , has logic provides access database android application , has servlets written external communication (more later).
the second 1 on google cloud engine. application written in meteor (to simplify, it's node.js). communicate between servers (gce -> gae). have rest api on servlet endpoint under address e.g. https://appname.appspot.com/admin/upload. when i'm making request without authentication, work fine:
http.get(geturl, {}, getcallback);
however, have no idea how using oauth2 authentication. when go address https://appname.appspot.com/admin/upload browser, redirects me google authentication , works fine (i have account added in google console). how send http request node.js server using oauth2 authentication?
to give more details, here servlet configuration:
<security-constraint> <display-name>securityconstraint</display-name> <web-resource-collection> <web-resource-name>wrcollection</web-resource-name> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>confidential</transport-guarantee> </user-data-constraint> </security-constraint>
and
<servlet-mapping> <servlet-name>uploadrequestservlet</servlet-name> <url-pattern>/admin/upload</url-pattern> </servlet-mapping>
i know have set server server communication how accomplish using node.js? help? don't know start...
if have problem server-to-server communication (meteor.js server google server) using oauth 2.0 checkout library i've created https://github.com/jagi/meteor-google-oauth-jwt. makes calling google rest api meteor.js server simpler.
Comments
Post a Comment