Usman Ismail
Usman Ismail

Reputation: 18679

Does google app engine provide an access control solution?

Is there any access control solution available for apps running in google app engine? I am specifically interested in IP white listing.

Upvotes: 3

Views: 2438

Answers (2)

Michael
Michael

Reputation: 1397

I have a similar need of White Listing IPs. I have a list of allowed IPs in the datastore, and then every request to AppEngine I just check the calling IP address and check to see if it is listed in the memcache, if it isn't I query it in the data store. If I find it I persist it on the memcache for future requests and return the request. If I don't find it I log it and return an error.

The reason for persisting the IP in the memcache is because if I have one request coming in from an IP chances are they will send more requests soon (because they are logged in and doing stuff).

To get the IP in appengine (in java) I use

String IPString = getThreadLocalRequest().getRemoteAddr();

Upvotes: 1

Paul Collingwood
Paul Collingwood

Reputation: 9116

There are three roles available with regard to the administration console.

Viewer, Developer and Owner.

https://developers.google.com/appengine/docs/adminconsole/roles

In addition, you can restrict access to users on a specific domain.

But you probably want this:

https://developers.google.com/appengine/docs/python/gettingstarted/usingusers

You can then force users to sign in via google (or a few other choices) and you get to see their unique ID. You can then use that unique ID to grant or deny access to various parts of your site.

https://developers.google.com/appengine/docs/python/tools/webapp/utilmodule

Google App Engine provides several useful services based on Google infrastructure, accessible by applications using libraries included with the SDK. One such service is the Users service, which lets your application integrate with Google user accounts. With the Users service, your users can use the Google accounts they already have to sign in to your application. Blockquote

Upvotes: 2

Related Questions