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

dmsi ClientCredentials can't be loaded correctly even with ClientCredentials provided Error: System.ArgumentException: Delegate to an instance method cannot have null 'this' #3111

Open
Jiajun0815 opened this issue Oct 24, 2024 · 1 comment

Comments

@Jiajun0815
Copy link

Microsoft.Identity.Web Library

Microsoft.Identity.Web.OWIN

Microsoft.Identity.Web version

3.2.2

Web app

Sign-in users

Web API

Not Applicable

Token cache serialization

Not Applicable

Description

ClientCredentials which are not supposed to be needed are blocking us WebAppJWT_IDWeb_OWIN - Repos (visualstudio.com)

dmsi ClientCredentials can't be loaded correctly even with ClientCredentials provided Error: System.ArgumentException: Delegate to an instance method cannot have null 'this'

Reproduction steps

run the WebAppJWT_IDWeb_OWIN sample from https://msazure.visualstudio.com/One/_git/EngSys-Security-dSTS?path=%2fSecurity%2fSamples%2fJWTSamples%2fWebAppJWT_IDWeb_OWIN&version=GC71a7e2cc2f2b22f5d9637e2700a140239d408036

Error message

No response

Id Web logs

[ArgumentException: Delegate to an instance method cannot have null 'this'.]
System.MulticastDelegate.ThrowNullThisInDelegateToInstance() +60
Microsoft.Identity.Web.d__1.MoveNext() +596
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Identity.Web.d__24.MoveNext() +1668
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Identity.Web.d__23.MoveNext() +550
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Identity.Web.d__14.MoveNext() +410
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Identity.Web.<b__2>d.MoveNext() +768
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Security.OpenIdConnect.d__11.MoveNext() in //src/Microsoft.Owin.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs:432
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.Owin.Security.OpenIdConnect.d__11.MoveNext() in /
/src/Microsoft.Owin.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs:577
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Security.Infrastructure.d__31.MoveNext() in //src/Microsoft.Owin.Security/Infrastructure/AuthenticationHandler.cs:70
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Security.Infrastructure.d__5.MoveNext() in /
/src/Microsoft.Owin.Security/Infrastructure/AuthenticationMiddleware.cs:28
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__7.MoveNext() in //src/Microsoft.Owin.Host.SystemWeb/IntegratedPipeline/IntegratedPipelineContextStage.cs:85
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Security.Infrastructure.d__5.MoveNext() in /
/src/Microsoft.Owin.Security/Infrastructure/AuthenticationMiddleware.cs:30
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__7.MoveNext() in //src/Microsoft.Owin.Host.SystemWeb/IntegratedPipeline/IntegratedPipelineContextStage.cs:85
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__12.MoveNext() in /
/src/Microsoft.Owin.Host.SystemWeb/IntegratedPipeline/IntegratedPipelineContext.cs:153
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) in /_/src/Microsoft.Owin.Host.SystemWeb/IntegratedPipeline/StageAsyncResult.cs:76
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +505
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +182
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

Relevant code snippets

https://msazure.visualstudio.com/One/_git/EngSys-Security-dSTS?path=%2fSecurity%2fSamples%2fJWTSamples%2fWebAppJWT_IDWeb_OWIN&version=GC71a7e2cc2f2b22f5d9637e2700a140239d408036

Regression

No response

Expected behavior

user being able to login without ClientCredentials or dmsi works

@jmprieur
Copy link
Collaborator

The Microsoft.Identity.Client.dDMSI library does not take a dependency on the right ID Web, as MSAL changed the way to handle signed assertions (absorbed by IdWeb).
Also the sample does not use the right signed assertion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants