google-app-engine


How to check service-to-service authentication in Google App Engine?


I'm trying to split a monolith Google App Engine application (using Python & standard environment) into several services within one application. Default service is calling API implemented using the endpoints framework in another service.
Everything works nicely except that I don't understand how to correctly check authentication of the default service (and make it work both in local development server and in production).
To call the service I'm using google-api-python-client and default application credentials.
from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
service = build(
name, version,
credentials=GoogleCredentials.get_application_default(),
discoveryServiceUrl=discovery_url)
service.client_token().execute()
My service API code looks like the following
#endpoints.api(
name='test',
version='v1',
)
class TestApi(remote.Service):
#endpoints.method(
message_types.VoidMessage,
TestResponse,
path='test',
http_method='GET',
name='test')
def get_test(self, request):
# user = endpoints.get_current_user()
# if not user:
# raise endpoints.UnauthorizedException
return TestResponse(test='test')
In production endpoints.get_current_user() seems to return a correct application user, but I don't know how to correctly validate that it's the same application. In local development environment endpoints.get_current_user() returns None.

Related Links

Problems getting a basic JAXRS + JPA version working on GAE
Appengine's Indexing order, cursors, and aggregation
Works locally but throws java.lang.IncompatibleClassChangeError when deployed to GAE
Google App Engine Datastore: Turkish Characters won't sort properly
JPA + Google SQL + GWT + Eclipse
how to convert the string version of a key back into a form that I can use the get() function on to get the entity instance
Redirect To Specific URL in Google app engine
Exporting data to Google Spreadsheet from Google App Engine (Java version)
How is md5Hash calculated for com.google.appengine.api.blobstore.BlobInfo
Bad response to a BigQuery query: kind:discovery#restDescription instead of bigquery#queryResults
Google app engine jobs in datastore admin freeze
BadValueError('Property %s must be a float' % self.name) BadValueError: Property USD must be a float
HttpError 400 in jobs.get(jobId,ProjectId) even with right values
GAE - creating an app issue
Is NDB model _post_delete_hook called after transaction? OR Best way to clean a blob from the blobstore when its referencing entity is deleted
If verify Google user logged in

Categories

HOME
sonarqube
assembly
localization
gdb
numbers
knitr
gradient
tvos
android-json
retrofit2
nstableheaderview
syntaxnet
google-schemas
redis-sentinel
rtf
selenium-ide
docx
atlassian-stash
easyphp
jersey-1.0
smartclient
nodemcu
sar
symbols
poedit
mongoid6
object-storage
aggregation
google-api-client
ckfinder
data.stackexchange.com
siri
licensing
appirater
fragment-backstack
aws-codecommit
postback
mustache
mockjax
android-gridview
gojs
jwplayer6
slacktextviewcontroller
jpad
subclipse
facebook-social-plugins
procfile
puredata
cnc
reportservice2010
oracleclient
dt
lsyncd
cpu-cache
mathcad
baidu
bootstrap-tags-input
branch-prediction
omxplayer
android-dateutils
google-query-language
nservicebus5
angular-ui-typeahead
thread-sleep
jdi
fuelcms
sapscript
jdk1.7
amiga
phpldapadmin
at-job
theos
android-cookiemanager
formview
nsmenu
grails-domain-class
matrix-inverse
jjaql
ray
dct
buffering
accesscontrolexception
mt4j
jeromq
dtmf
video-codecs
insert-id
preload
intersect
entity-attribute-value
u2netdk
automationelement
http-daemon
svk
presentation-layer
globals
jqueryform
addchild
zend-rest
django-piston
purepdf
int64
entitykey
httpcookie

Resources

Encrypt Message