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

Expose Credential type for DefaultAzureCredential and ChainedTokenCredential #8948

Closed
jongio opened this issue Nov 29, 2019 · 2 comments
Closed
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.

Comments

@jongio
Copy link
Member

jongio commented Nov 29, 2019

When using DefaultAzureCredential or ChainedTokenCredential I find it useful to know which credential type is being used. Right now I have to resort to reflection or EventSource:

using var listener = new AzureEventSourceListener((eventArgs, text) => AzureEventSourceHandler(eventArgs, text), EventLevel.Informational);

        static void AzureEventSourceHandler(EventWrittenEventArgs eventArgs, string text)
        {
            if (text.Contains("Credential") && text.Contains("succeeded"))
            {
                Console.WriteLine(text);
            }
        }

I would rather do something like this:

var credential = new DefaultAzureCredential();
credentail.GetToken();
credential.GetType();  // and this return the type used

or

credential.GetCredentialType(); // if overriding GetType() is a problem due to composition model

I understand that GetToken isn't called until a network call is needed, but a user could call GetToken() first if they really need to know the Credential type.

@triage-new-issues triage-new-issues bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 29, 2019
@jongio
Copy link
Member Author

jongio commented Nov 30, 2019

Related: Azure/azure-sdk-for-java#6591

@schaabs schaabs added Azure.Identity Client This issue points to a problem in the data-plane of the library. labels Dec 3, 2019
@triage-new-issues triage-new-issues bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 3, 2019
@christothes christothes added the feature-request This issue requires a new behavior in the product in order be resolved. label Apr 12, 2021
@JimSuplizio
Copy link
Member

Hi @jongio, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@JimSuplizio JimSuplizio closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure Identity SDK Improvements Mar 5, 2024
@Azure Azure locked and limited conversation to collaborators Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.
Projects
Development

No branches or pull requests

4 participants