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

CloudBlobContainer authentication error when repeating listBlobs() #82

Open
avinabmalla opened this issue Aug 24, 2020 · 1 comment
Open

Comments

@avinabmalla
Copy link

The method CloudBlobContainer.listBlobs() works when called the first time after installing the app, but will not work again and throw the following MAC signature invalid error.

The MAC signature found in the HTTP request 'xxxxxxxxxx' is not the same as any computed signature. Server used following string to sign: 'GET

Mon, 24 Aug 2020 14:39:19 GMT

x-ms-client-request-id:5830d2ce-c356-40c0-a9a1-cecd66921336
x-ms-date:Mon, 24 Aug 2020 16:48:29 GMT
x-ms-version:2017-04-17
/myaccoun t/mycontainer
comp:list
delimiter:/
restype:container'.

The listBlobs() method will only work for the same container again after the app's cache is cleared.

I am using the following code to list blobs (Kotlin)

`
val storageAccount = CloudStorageAccount.parse(connectionString)
val blobClient = storageAccount.createCloudBlobClient()
val container = blobClient.getContainerReference(name)
val blobs = container.listBlobs()

val blobNames: ArrayList = ArrayList()
for (blob in blobs) {
blobNames.add((blob as CloudBlockBlob).name)
}
`

@avinabmalla
Copy link
Author

Looks like the old requests are being cached in the com.microsoft.identity.http-cache folder in the app's cache directory. I need to delete the folder every time I run listBlobs().

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

No branches or pull requests

1 participant