Skip to content

Conversation

@pranavkm
Copy link
Contributor

Fixes #30751
Fixes #35162

@pranavkm pranavkm requested a review from a team as a code owner January 28, 2022 18:00
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jan 28, 2022
Copy link
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some formatting nits

@pranavkm
Copy link
Contributor Author

pranavkm commented Jan 28, 2022

Authentication.MSAL was already annotated for trimming. However WebAssembly.Authentication previously wasn't. Investigating this issue, the underlying issue was that our JSRuntime.Invoke* APIs aren't annotated accurately. Essentially, all of the args array is subject to serialization constraints, but we don't express this. Unfortunately, the best we could do is slap a RequiresUnreferencedCode on these methods.

In this particular case, MsalProviderOptions is passed as a JSRuntime.InvokeAsync argument but was being trimmed (all of the getters were being removed). Annotating the entry point as this PR does helps, but it would help to revist JSRuntime's annotations.

@TanayParikh
Copy link
Contributor

Annotating the entry point as this PR does helps, but it would help to revist JSRuntime's annotations.

Do we have a tracking issue for this?

@pranavkm pranavkm enabled auto-merge (squash) January 28, 2022 18:26
@pranavkm pranavkm merged commit ed423dc into dotnet:main Jan 28, 2022
@pranavkm pranavkm deleted the annotate branch January 28, 2022 20:03
@ghost ghost added this to the 7.0-preview1 milestone Jan 28, 2022
@SteveSandersonMS
Copy link
Member

Great that you were able to resolve the issue with the authentication libraries!

Investigating this issue, the underlying issue was that our JSRuntime.Invoke* APIs aren't annotated accurately. Essentially, all of the args array is subject to serialization constraints, but we don't express this. Unfortunately, the best we could do is slap a RequiresUnreferencedCode on these methods.

By that do you mean we're unable to annotate them because the right kinds of annotation don't exist and we'd need to ask for new compiler features, or do you mean we can and should put [RequiresUnreferencedCode] on the interface methods?

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

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blazor WebAssembly MSAL authentication error Annotate and mark remaining Blazor WASM assemblies

4 participants