[BUG] Potential authorization issue with Confidential Ledger
See original GitHub issueLibrary name and version
Azure.Security.ConfidentialLedger 1.0.0-beta.2
Describe the bug
- Not able to use the certificate based authentication method for authenticating with the Azure Confidential Ledger data plane APIs
- ConfidentialLedgerClient class’s constructor expects TokenCredentials to be not null. Only one should be needed as Authentication can be done via either Certificate or AAD
- ConfidentialLedgerClient seems to validate TokenCredential Paramter to ensure that its not null… but if the client code chooses to use cert based authentication and not rely on TokenCredentials - it throws an error
Expected behavior
- Should be able to use either TokenCredentials or Certificate based credentials
Actual behavior
- Not able to use either TokenCredentials or Certificate based credentials. Code expects both.
Reproduction Steps
Run the below code where the TokenCredentials is not present.
private static void SDKClient(StringContent request, HttpClientHandler handler)
{
try
{
var options = new ConfidentialLedgerClientOptions { Transport = new HttpClientTransport(handler) };
var ledgerClient = new ConfidentialLedgerClient(new Uri(_ledgerURI), null, options);
RequestContent requestContent = RequestContent.Create(request);
var responseForPost = ledgerClient.PostLedgerEntry(requestContent);
Console.WriteLine(responseForPost.Content);
}
catch (HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
Console.WriteLine("Message :{0} ", e.Message);
}
}
Environment
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Any operation on ledger client in Azure Confidential ...
It sounds like you are attempting to authenticate with the Confidential Ledger using an AAD App. This AAD app may not have been...
Read more >Manage certificate-based users in Azure confidential ledger
Get the confidential ledger's name and the identity service URI from the Azure portal; it will be needed to create a client to...
Read more >Privacy policy
We can collect personal data about you when you use these Services. We have created this Confidentiality Policy to explain what we do...
Read more >azure-confidentialledger
Authenticate the client. Using Azure Active Directory. This document demonstrates using DefaultAzureCredential to authenticate to the Confidential Ledger via ...
Read more >Confidential Ledger Flexibility | Techs & Specs Blog
Confidential ledger can help to prevent data breaches, protect sensitive information, and meet compliance requirements. This is a great way to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
tracking this in #28147
thanks! this seems to be available in Python SDK
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md?plain=1#L181
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/README.md?plain=1#L237
https://azuresdkdocs.blob.core.windows.net/$web/python/azure-confidentialledger/latest/azure.confidentialledger.html?highlight=certificatecredential#azure.confidentialledger.ConfidentialLedgerCertificateCredential