question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Potential authorization issue with Confidential Ledger

See original GitHub issue

Library 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found