edit-icon download-icon

Authorized access

Last Updated: Oct 25, 2017

SDK supports the signing of the URL with a validity period or a public resource URL so that the URL can be transferred to a third party for authorized access.

Sign a private resource URL with a validity period

For a bucket or an object not assigned the public-read permission, the following interface can be called to obtain a signed URL to access the bucket or object:

  1. String url = oss.presignConstrainedObjectURL("<bucketName>", "<objectKey>", 30 * 60);

Sign a public resource URL

For a bucket or an object with the public-read permission, the following interface can be called to obtain a public URL to access the bucket or object:

  1. String url = oss.presignPublicObjectURL("<bucketName>", "<objectKey>");
Thank you! We've received your feedback.