I am generating SAS (shared access signature) token for my Azure blob containers with private access level using .net core application and it is working fine.
Code:
private static string GetContainerSasUri(CloudBlobContainer container, string storedPolicyName = null)
{
string sasContainerToken;
if (storedPolicyName == null)
{
SharedAccessBlobPolicy adHocPolicy = new SharedAccessBlobPolicy()
{
SharedAccessStartTime = DateTime.UtcNow.AddMinutes(-1),
SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(2),
Permissions = SharedAccessBlobPermissions.Read
};
sasContainerToken = container.GetSharedAccessSignature(adHocPolicy, null);
}
else
sasContainerToken = container.GetSharedAccessSignature(null, storedPolicyName);
return container.Uri + sasContainerToken;
}
Now I want to do the same using Angular (generating SAS tokens). I've googled it and found some links but none of them explain this in detail. Is there anyway to do this?