In my rails 3 application, I am using carrierwave gem (version 0.5.6). I would like to use Google Storage for developers for storing the uploaded files. I have created an initalizer which looks like following:
CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'Google',
:google_storage_access_key_id => 'xxxx',
:google_storage_secret_access_key => 'yyyy'
}
config.fog_directory = 'directory'
end
I am getting 403 forbidden message with
...<Error><Code>InvalidSecurity</Code><Message>The provided security credentials are not valid.</Message>...
I have just enabled my Google Storage using the apis-console, and I can upload files using the online 'Google Storage Manager'. For 'google_storage_access_key_id' in the initializers file above, I am using 'Google Storage Id' for 'You' in the 'Storage Access' page. For 'google_storage_secret_access_key', I am using the 'Legacy storage access keys'.
I don't know how to proceed. Could someone kindly point me towards how to get about debugging this issue?
Thanks, Saksham
Ok, I am feeling insanely retarded, but it took my almost a complete day to find the correct keys in the Google API Console. I could not find the information at all in the new interface.
So here are the minimal steps to find your access key and secret
Google Cloud Storage
: Storage Access and Interoperable Access, click on Interoperable AccessGOOG
)
google_storage_access_key_id
)Show
button, behind the access key to actually show the corresponding secret
google_storage_secret_access_key
I hopes this helps anybody. I found the names of the fog-configuration-keys confusing enough to actually switch the values, and it took me ages to actually discover the Show
button actually showed the secret. Doh! So I hope this can help some other souls.
It sounds like you've enabled the legacy access keys for your account. From the Google APIs console select Google Storage and then click on legacy access.
Use the access key from that page here:
google_storage_access_key_id => 'xxxx',
From the APIs console click show to display your secret key. Use that key here:
google_storage_secret_access_key => 'yyyy'
Do not use the Google ID for legacy access.
Hope this helps,
Anthony
To generate a developer key in 2016:
Visit this page: https://console.cloud.google.com/projectselector/storage/settings
The Google API console gui is not the most friendly user interface, so that's why I'm putting detailed instructions. I am writing this as of October 2013. The interface is now changed but Google API Console still enables you to use legacy access. If you are using the new Google Cloud Console, look on the bottom left hand corner and you will see the message "This is an experimental version of the API Access page. Some features may not be available." Click the words "API Access page" to get you to the legacy access. Then on the left menu select "Google Cloud Storage". Underneath that you will see two other fixed submenus, "Storage Access" and "Interoperable Access". On the "Storage Access" submenu page, enable "Interoperable Access" if you haven't done so already. Then on the "Interoperable Access" submenu page, you can get your Storage Access Keys for use in fog configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With