Tuesday, 15 July 2014

java - How do I implement oAuth 2.0 in Google App Engine with RESTEasy? -



java - How do I implement oAuth 2.0 in Google App Engine with RESTEasy? -

i developing google app engine rest service , want utilize oauth 2.0 authentication. added next code service methods check valid user , works in throws exception when not authenticated.

try { final oauthservice oauth = oauthservicefactory.getoauthservice(); final user user = oauth.getcurrentuser(); } grab (final oauthrequestexception e) { throw new runtimeexception(e); }

now want authenticate against command line programs written in java , python.

i have spent hours searching google , stackoverflow both , can't find single lucid illustration of how authenticate against gae application non-browser application makes sense. found lots of examples on how authenticate against google's own api's nil authenticating against own google app engine application.

can provide instructions on how authenticate against google app engine application either java or python?

solution

i got oauth 2.0 working on google app engine application. have uploaded illustration command line tool client code github account. way much code publish here in code boxes. update reply when finish blog post how got working , how code works.

resteasy

use code posted in question access user authenticated first thing in each service method, throw , exception if user isn't authenticated.

credits

thanks fábio uechi posting code worked , needed updating. did more little updating , refactored out bit what had done.

java python google-app-engine oauth oauth-2.0

No comments:

Post a Comment