[BUG] No way to specify local VS credentials for GraphServiceClient #44620
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Library name and version
Microsoft.Identity.Web 2.19.0
Azure.Identity 1.12.0
Microsoft.Graph 5.56.0
Describe the bug
When we configure authentication in asp.net we can specify to include the default
GraphServiceClient
object creation by callingAddMicrosoftGraph
method. The default token config forGraphServiceClient
is picked up from config as documented here.There is no way in config I could figure that we can mention to use 'VS/VS code credentials' for local environment debugging purpose. You have to mention either certificate or secret for local environments which we want to avoid.
Expected behavior
There should be an easy option to use 'logged in user token' from VS or VS Code inside
ClientCredentials
so that for local environment you can still use the same config based approach for the defaultGraphServiceClient
. E.g. for our scenario when we deploy inside AKS cluster we use federated credential flow to authenticate, that we can mention by adding source asSignedAssertionFilePath
. For web apps we can useSignedAssertionFromManagedIdentity
. But for local machine none of these works without using cert/secret. I would expect to have a type for local may be as**VSOBOIdentity**
I am aware of ways to customize the creation of the client, like mentioned here e.g. I can create custom wrapper using below code that will work in AKS or local machine, but that needs unnecessary custom code.
Actual behavior
N/A
Reproduction Steps
Enable authentication in code as
In appsettings.json add below config (only kept necessary configs for downstream api call
Environment
No response
The text was updated successfully, but these errors were encountered: