You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we use MSAL libraries for authentication and authorization in our service and "Microsoft.Identity.Web.GraphServiceClient" Version="2.18.1" which uses Microsoft Graph v5 to be able to leverage .AddMicrosoftGraph to pass token to downstream graph apis but we are getting TypeLoadException when it tries to call downstream graph api:
The code:
services.AddAuthentication(S2SAuthenticationDefaults.AuthenticationScheme)
.AddMiseWithDefaultAuthentication(_config.RawConfig)
.EnableTokenAcquisitionToCallDownstreamApiAndDataProviderAuthentication(S2SAuthenticationDefaults.AuthenticationScheme)
.AddMicrosoftGraph()
.AddInMemoryTokenCaches();
The exception:
System.TypeLoadException: Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.31.0.0, Culture=neutral, at ScenarioHealth.Adapters.GraphApi.MicrosoftGraphAdapter.CheckUserEmailAsync(String emailOrAlias)
Any chance you can raise this at the link below to get more context from the owners of the Microsoft.Identity.Web.GraphServiceClient library? It looks like the code is trying to reference Microsoft.Graph.IGraphServiceUsersCollectionPage which is not available in v5 of the SDK.
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.
we use MSAL libraries for authentication and authorization in our service and "Microsoft.Identity.Web.GraphServiceClient" Version="2.18.1" which uses Microsoft Graph v5 to be able to leverage .AddMicrosoftGraph to pass token to downstream graph apis but we are getting TypeLoadException when it tries to call downstream graph api:
The code:
services.AddAuthentication(S2SAuthenticationDefaults.AuthenticationScheme)
.AddMiseWithDefaultAuthentication(_config.RawConfig)
.EnableTokenAcquisitionToCallDownstreamApiAndDataProviderAuthentication(S2SAuthenticationDefaults.AuthenticationScheme)
.AddMicrosoftGraph()
.AddInMemoryTokenCaches();
The exception:
System.TypeLoadException: Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.31.0.0, Culture=neutral, at ScenarioHealth.Adapters.GraphApi.MicrosoftGraphAdapter.CheckUserEmailAsync(String emailOrAlias)
The packages being used:
"Microsoft.Identity.ServiceEssentials.AspNetCore" Version="1.25.0"
"Microsoft.Identity.ServiceEssentials.TokenAcquisitionIdWeb" Version="1.25.0"
"Microsoft.IdentityModel.S2S" Version="4.6.0"
"Microsoft.Identity.Web.GraphServiceClient" Version="2.18.1"
Is there any mismatch in the packages that are being used? what could cause this error?
The text was updated successfully, but these errors were encountered: