Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A public URL is generated for a google CDN object, if bucket object is not public, authentication issue occurs. #33

Open
shivamkrpandey opened this issue Apr 6, 2018 · 1 comment
Labels

Comments

@shivamkrpandey
Copy link

Added makePublic: true in the config to get the permanent URL of the bucket object but the object was not set to be publically readable in the bucket hence URL is generated but the authorisation issues occur for all the generated mediaLink.

@shivamkrpandey
Copy link
Author

shivamkrpandey commented Apr 6, 2018

Here on docs I found a solution

BlobId blobId = BlobId.of(bucketName, blobName, blobGeneration);
Acl acl = storage.createAcl(blobId, Acl.of(User.ofAllUsers(), Role.READER));

#Ref: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java

We need to create an acl entry (change in the Access control list) for the bucket object that is blobId here to make individual objects publicly readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant