I have a MVC application where a list of users can upload files to GoogleDrive/DropBox and for this they just need to authenticate themselves and the corresponding api provides an 'AccessToken' or something which is further used to upload files to user account from my web application.
Now I need to do same thing with Azure Blob Storage. For testing I created an account there and using Accountname and Accountkey created a connection string which do the same like this:
public void UploadFileToBlob1(string fileName, byte[] fileData)
{
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(System.Configuration.ConfigurationManager.AppSettings["StorageConnectionString"]);
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("portalcontainer");
container.CreateIfNotExists();
// Retrieve reference to a blob named "myblob".
CloudBlockBlob blockBlob = container.GetBlockBlobReference(fileName);
// Create or overwrite the "myblob" blob with contents from a local file.
Stream stream = new MemoryStream(fileData);
blockBlob.UploadFromStream(stream);
}
Now I want to make user who logged into my app, can do same.
So in case of Azure blob storage what can I do to authenticate the logged in user on Blob storage account and get an 'accesstoken' or something to perform file upload/download on the user blob container.
Please advice