Перейти до основного вмісту

Store files in Google Cloud Storage

This guide explains how to store the uploaded files of Casdoor, such as avatars, in Google Cloud Storage.


Learning outcomes​

  • Create a service account key with access to the bucket.
  • Add Google Cloud Storage as a storage provider in Casdoor.

What you need​

  • A Google Cloud project with a Cloud Storage bucket
  • Administrator access to the Casdoor admin console

Create a service account key​

  1. Create a service account and grant it IAM permissions on the bucket. See Authentication for Cloud Storage.
  2. Create a key for the service account and download it as a JSON file.

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Storage and Type to Google Cloud Storage.

  3. Fill in the fields:

    Casdoor fieldGCP / meaningНеобхідний
    Service Account JSONService account key (JSON content)Yes
    EndpointEndpoint (optional)Ні
    BucketBucket nameТак

    Google Cloud Storage provider in Casdoor

  4. Save the provider.

See also​