-
Notifications
You must be signed in to change notification settings - Fork 219
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
Adding Extensibility for Custom Signed Assertion Providers #3226
base: master
Are you sure you want to change the base?
Adding Extensibility for Custom Signed Assertion Providers #3226
Conversation
SummarySummary
CoverageNo assemblies have been covered. |
SummarySummary
CoverageNo assemblies have been covered. |
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start
I left some questions/comments. I'm puzzled by the exceptions.
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
if (CredentialSourceLoaders.TryGetValue(credentialDescription.SourceType, out ICredentialSourceLoader? loader)) | ||
if (credentialDescription.SourceType == CredentialSource.CustomSignedAssertion) | ||
{ | ||
await ProcessCustomSignedAssertionAsync(credentialDescription, parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method throws, but we don't catch the exception, which btw is internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmprieur
I'm a bit confused as to why we would need to catch it here since it is logged inside the ProcessCustomSignedAssertionAsync method. In the similar example on lines 87 and 88 for other source types when we do catch the exception, we do so to log it before throwing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to throw at all in the extensibility (the code you are adding). We are in control of that code. But we need to catch the exception sent by the extensions (the code that extenders will write). So indeed, you should have something like line 83
…rCustomSignedAssertion.cs Co-authored-by: jennyf19 <[email protected]>
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
SummarySummary
CoverageNo assemblies have been covered. |
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoaderCustomSignedAssertion.cs
Outdated
Show resolved
Hide resolved
I mistook "log a new error" from the spec for throw a new exception |
SummarySummary
CoverageNo assemblies have been covered. |
TODO write description :)
Fixes #3220