Google Cloud Storage: Real World - Bucket authorization

82 views
Skip to first unread message

k...@form-runner.com

unread,
Nov 22, 2013, 9:57:47 PM11/22/13
to google-a...@googlegroups.com
So I have GCS-API-client library code working in my app on the Development Console.  Now I need to get things running on GAE, accessing GCS.

I have a Google Cloud Console Account set up with billing enabled, have enabled the Google Cloud Storage API, and have created a bucket called my_bucket.

On GAE, I have a production and a test version of the app:  myproject.appspot.com and testmyproject.appspot.com (same source code).  I want both of these GAE apps to be able to write and read  (FULL CONTROL) to my_bucket.  Both of these apps have been entered on Registered apps on Cloud Console.

But I'm not clear about how to provide my apps with authorization to access to my_bucket.  I think the nature of access needed corresponds to the Server Key type of authorization that one sees when clicking on the app's listing under Registered apps.  All we are doing at present is  storing Blobs bigger than 1MB in GCS.  BUT, if this is correct, I don't understand how to  attach the ServerKey / APIKey to our library code to accomplish authorization.  If I've missed a doc that explains this, please give me a link.  And if I'm completely off-base, please point me to the right doc to get straight.

Many thanks in advance,
--Ken Bowen

Vinny P

unread,
Nov 23, 2013, 1:46:13 AM11/23/13
to google-a...@googlegroups.com
On Fri, Nov 22, 2013 at 8:57 PM, <k...@form-runner.com> wrote:
I have a Google Cloud Console Account set up with billing enabled, have enabled the Google Cloud Storage API, and have created a bucket called my_bucket. But I'm not clear about how to provide my apps with authorization to access to my_bucket... I don't understand how to  attach the ServerKey / APIKey to our library code to accomplish authorization.


You don't need to attach any keys to your code. App Engine and Cloud Storage handle authentication for you. 

Log in to the cloud console, select the application you're using, then open up the Cloud Storage menu. Check the box next to the bucket you're using, then press the Bucket Permissions button. You'll see a screen similar to this: http://imgur.com/gadnQEF . All you need to do is insert (your application id) @ appspot . gserviceaccount . com (without spaces) as a privileged user on the bucket. 

From here, your application will have access to the bucket. Just open a channel to the bucket using the GCS library, and GAE will handle authenticating to the bucket.
 
 
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 

Ken Bowen

unread,
Nov 23, 2013, 2:39:24 PM11/23/13
to google-a...@googlegroups.com, Vinny P
Vinny,
Thank you very much! That got me going. I especially appreciate the screen shot on imgur, because on my MacBook Pro, none of Chrome,FF,Safari showed the bottom portion of the page for adding unless I suppressed the Nav or Bookmarks bar, and there's no vertical scroll bar.
Cheers,
Ken Bowen
> --
> You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/D4ZwnBhj9yM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
> To post to this group, send email to google-a...@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.

Vinny P

unread,
Nov 24, 2013, 7:39:23 PM11/24/13
to google-a...@googlegroups.com
On Sat, Nov 23, 2013 at 1:39 PM, Ken Bowen <k...@form-runner.com> wrote:
Vinny,
Thank you very much!   That got me going.  I especially appreciate the screen shot on imgur, because on my MacBook Pro, none of Chrome,FF,Safari showed the bottom portion of the page for adding unless I suppressed the Nav or Bookmarks bar, and there's no vertical scroll bar.


No problem! Glad to hear everything's working for you.

Ken Bowen

unread,
Dec 3, 2013, 9:24:22 PM12/3/13
to google-a...@googlegroups.com
Hi Vinny,

Thanks for the invite to your Google+ circle. I don't have a Google+ account right now, but I plan to set one up for myself and for my company in January when, hopefully, our business opens it's doors. You'll see me show up in your circle then.
Cheers,
Ken
Reply all
Reply to author
Forward
0 new messages