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

Reference to type 'IAuthenticationProvider' claims it is defined in 'Microsoft.Graph.Core', but it could not be found #928

Closed
C-lare-M-oore opened this issue Nov 7, 2024 · 2 comments
Labels
no-recent-activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@C-lare-M-oore
Copy link

Describe the bug

I am trying to use the graph api client with a client id and secret, to get user information from entra. I got all the calls working in postman and now i'm trying to get my azure function app to do the same thing.

Expected behavior

I have been following various samples to try and do a simple query but every time i try to create a graphserviceclient i get the compile error in the title.

Reference to type 'IAuthenticationProvider' claims it is defined in 'Microsoft.Graph.Core', but it could not be found

How to reproduce

This is my code (secret removed for obvious reasons


string[] scopes = {"https://graph.microsoft.com/.default"};
var clientId = "22820207-4185-47ce-874d-d10f6c3b9535";
var tenantId = "378620f7-aa4a-40ac-902a-2ef913d8ed69";
var clientSecret = "*****";

var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);

var httpClient = GraphClientFactory.Create( version: "beta");

var authProvider = new AzureIdentityAuthenticationProvider(clientSecretCredential, scopes);

var adapter = new BaseGraphRequestAdapter(authProvider);

var graphClient = new GraphServiceClient(adapter);

var graphClient = new GraphServiceClient(adapter); this line causes the issue

SDK Version

every version i have tried including latest

Latest version known to work for scenario above?

none

Known Workarounds

none

Debug output

no debugt output because it doesnt compile

Configuration

Windows 11
x64

Other information

No response

@C-lare-M-oore C-lare-M-oore added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Nov 7, 2024
@andrueastman
Copy link
Member

Thanks for raising this @C-lare-M-oore

Any chance you can confirm the version of the library you are using? Is it the latest version available here? https://www.nuget.org/packages/Microsoft.Graph.core#versions-body-tab

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Nov 7, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-recent-activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants