Skip to content

Commit

Permalink
CAMEL-21287: Camel-Azure-Files add missing header for AZURE_IDENTITY
Browse files Browse the repository at this point in the history
The header x-ms-file-request-intent must be set before calling the file share api using a bearer token.
  • Loading branch information
s-clauw authored Sep 30, 2024
1 parent f73c6e8 commit 2caad99
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.azure.storage.file.share.models.ShareFileItem;
import com.azure.storage.file.share.models.ShareFileRange;
import com.azure.storage.file.share.models.ShareStorageException;
import com.azure.storage.file.share.models.ShareTokenIntent;
import com.azure.storage.file.share.options.ShareDirectoryCreateOptions;
import com.azure.storage.file.share.options.ShareFileRenameOptions;
import com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions;
Expand Down Expand Up @@ -717,6 +718,7 @@ private ShareServiceClient createClient() {
builder = builder.sasToken(token.toURIQuery());
} else if (configuration.getCredentialType().equals(CredentialType.AZURE_IDENTITY)) {
builder = builder.credential(new DefaultAzureCredentialBuilder().build());
builder.shareTokenIntent(ShareTokenIntent.BACKUP);
}
return builder.buildClient();
}
Expand Down

0 comments on commit 2caad99

Please sign in to comment.