Skip to content

Blazor WebAssembly Msal TryAddAdditionalParameter does nothing #48136

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

Closed
1 task done
jlavery416 opened this issue May 8, 2023 · 8 comments
Closed
1 task done

Blazor WebAssembly Msal TryAddAdditionalParameter does nothing #48136

jlavery416 opened this issue May 8, 2023 · 8 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.

Comments

@jlavery416
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm using MSAL authentication in a Blazor WASM app that supports multi-tenancy. To determine the tenant, I am attempting to attach the tenant the user has indicated as a query parameter to the authorization request being sent to an Azure AD B2C custom policy. However, I cannot get the TryAddAdditionalParameter() method on an InteractiveOptionsRequest to successfully add query parameters.

I believe I may be missing something--as this problem has already been reported in #44854, and a solution was reportedly introduced in #45028 that was included in 7.0.1--but I'm not sure what that would be.

The temporary workaround proposed in #45028 (adding a TrimmerRootDescriptor) does not work for me either.

The only way I can add the parameters is to do as the reporter in #44854 suggests and serialize and deserialize a dictionary to pass into TryAddAdditionalParameter(), but my understanding is that that will fail during a release build.

Any help would be greatly appreciated.

Expected Behavior

I expect whatever key and value I pass into TryAddAdditionalParameter() to be added onto the end of the authorize request.

Steps To Reproduce

Here's a minimal repo to see what I'm attempting to do and where it is failing: https://github.com/jlavery416/QueryParamsMinimalRepo

To run, you'll need to fill in the AzureAd settings with a set up b2c instance that has a custom policy you can reach, or you can set MSAL up for a different provider.

Again, all I'm trying to achieve is to see my parameters set on the authorize request.

Thanks again for any help y'all can provide.

Exceptions (if any)

No response

.NET Version

7.0.203

Anything else?

No response

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label May 8, 2023
@javiercn
Copy link
Member

javiercn commented May 9, 2023

@jlavery416 thanks for contacting us.

Can you turn logging to debug/trace level as described here and check the logs in the console?

@javiercn javiercn added feature-blazor-wasm-auth Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels May 9, 2023
@ghost
Copy link

ghost commented May 9, 2023

Hi @jlavery416. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jlavery416
Copy link
Author

@javiercn
Thanks for the speedy response!

Here are the logs you requested:
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[2]
Initializing root component 0 (QueryParamsMinimalRepo.Client.App)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 0 of type QueryParamsMinimalRepo.Client.App
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 1 (Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState) as child of 0 (QueryParamsMinimalRepo.Client.App)
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Verbose - handleRedirectPromise called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Verbose - getAllAccounts called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Info - Emitting event: msal:handleRedirectStart
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Verbose - handleRedirectPromise has been called for the first time, storing the promise
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getCachedNativeRequest called
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getCachedNativeRequest: No cached native request found
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - handleRedirectPromise - acquiring token from web flow
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : [03c4e3b9-e6fe-4575-bf99-5306325874cb] : [email protected] : Verbose - initializeServerTelemetryManager called
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : [03c4e3b9-e6fe-4575-bf99-5306325874cb] : [email protected] : Info - handleRedirectPromise called but there is no interaction in progress, returning null.
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 1 of type Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 2 (Microsoft.AspNetCore.Components.CascadingValue1[System.Threading.Tasks.Task1[Microsoft.AspNetCore.Components.Authorization.AuthenticationState]]) as child of 1 (Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 2 of type Microsoft.AspNetCore.Components.CascadingValue1[System.Threading.Tasks.Task1[Microsoft.AspNetCore.Components.Authorization.AuthenticationState]]
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 3 (Microsoft.AspNetCore.Components.Routing.Router) as child of 2 (Microsoft.AspNetCore.Components.CascadingValue1[System.Threading.Tasks.Task1[Microsoft.AspNetCore.Components.Authorization.AuthenticationState]])
dbug: Microsoft.AspNetCore.Components.Routing.Router[2]
Navigating to component QueryParamsMinimalRepo.Client.Pages.Index in response to path '' with base URI 'https://localhost:7205/'
dbug: Microsoft.AspNetCore.Components.Routing.Router[2]
Navigating to component QueryParamsMinimalRepo.Client.Pages.Index in response to path '' with base URI 'https://localhost:7205/'
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 3 of type Microsoft.AspNetCore.Components.Routing.Router
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 4 (Microsoft.AspNetCore.Components.RouteView) as child of 3 (Microsoft.AspNetCore.Components.Routing.Router)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 5 (Microsoft.AspNetCore.Components.Routing.FocusOnNavigate) as child of 3 (Microsoft.AspNetCore.Components.Routing.Router)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 3 of type Microsoft.AspNetCore.Components.Routing.Router
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 4 of type Microsoft.AspNetCore.Components.RouteView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 6 (Microsoft.AspNetCore.Components.LayoutView) as child of 4 (Microsoft.AspNetCore.Components.RouteView)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 5 of type Microsoft.AspNetCore.Components.Routing.FocusOnNavigate
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 4 of type Microsoft.AspNetCore.Components.RouteView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 6 of type Microsoft.AspNetCore.Components.LayoutView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 7 (QueryParamsMinimalRepo.Client.Shared.MainLayout) as child of 6 (Microsoft.AspNetCore.Components.LayoutView)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 6 of type Microsoft.AspNetCore.Components.LayoutView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 7 of type QueryParamsMinimalRepo.Client.Shared.MainLayout
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 8 (QueryParamsMinimalRepo.Client.Shared.NavMenu) as child of 7 (QueryParamsMinimalRepo.Client.Shared.MainLayout)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 9 (QueryParamsMinimalRepo.Client.Shared.LoginDisplay) as child of 7 (QueryParamsMinimalRepo.Client.Shared.MainLayout)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 10 (QueryParamsMinimalRepo.Client.Pages.Index) as child of 7 (QueryParamsMinimalRepo.Client.Shared.MainLayout)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 8 of type QueryParamsMinimalRepo.Client.Shared.NavMenu
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 11 (Microsoft.AspNetCore.Components.Routing.NavLink) as child of 8 (QueryParamsMinimalRepo.Client.Shared.NavMenu)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 12 (Microsoft.AspNetCore.Components.Routing.NavLink) as child of 8 (QueryParamsMinimalRepo.Client.Shared.NavMenu)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 13 (Microsoft.AspNetCore.Components.Routing.NavLink) as child of 8 (QueryParamsMinimalRepo.Client.Shared.NavMenu)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 9 of type QueryParamsMinimalRepo.Client.Shared.LoginDisplay
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 10 of type QueryParamsMinimalRepo.Client.Pages.Index
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 14 (Microsoft.AspNetCore.Components.Web.PageTitle) as child of 10 (QueryParamsMinimalRepo.Client.Pages.Index)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 15 (QueryParamsMinimalRepo.Client.Shared.SurveyPrompt) as child of 10 (QueryParamsMinimalRepo.Client.Pages.Index)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 11 of type Microsoft.AspNetCore.Components.Routing.NavLink
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 12 of type Microsoft.AspNetCore.Components.Routing.NavLink
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 13 of type Microsoft.AspNetCore.Components.Routing.NavLink
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 14 of type Microsoft.AspNetCore.Components.Web.PageTitle
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 16 (Microsoft.AspNetCore.Components.Sections.SectionContent) as child of 14 (Microsoft.AspNetCore.Components.Web.PageTitle)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 15 of type QueryParamsMinimalRepo.Client.Shared.SurveyPrompt
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[2]
Initializing root component 17 (Microsoft.AspNetCore.Components.Web.HeadOutlet)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 17 of type Microsoft.AspNetCore.Components.Web.HeadOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 18 (Microsoft.AspNetCore.Components.Sections.SectionOutlet) as child of 17 (Microsoft.AspNetCore.Components.Web.HeadOutlet)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 19 (Microsoft.AspNetCore.Components.Sections.SectionOutlet) as child of 17 (Microsoft.AspNetCore.Components.Web.HeadOutlet)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 18 of type Microsoft.AspNetCore.Components.Sections.SectionOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 18 of type Microsoft.AspNetCore.Components.Sections.SectionOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 19 of type Microsoft.AspNetCore.Components.Sections.SectionOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 19 of type Microsoft.AspNetCore.Components.Sections.SectionOutlet
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Info - Emitting event: msal:handleRedirectEnd
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 17 of type Microsoft.AspNetCore.Components.Web.HeadOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 20 (Microsoft.AspNetCore.Components.Sections.SectionContent) as child of 17 (Microsoft.AspNetCore.Components.Web.HeadOutlet)
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:31 GMT] : @azure/[email protected] : Verbose - getAllAccounts called
CSS Hot Reload ignoring https://localhost:7205/css/bootstrap/bootstrap.min.css because it was inaccessible or had more than 5000 rules.
Tools extension connected
Initializing tools services...
Initializing tools design surface service
Initializing tools selection service
Initializing tools tag navigation service
Initializing tools hotkey manager service
Host extension connected
Initializing host services...
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[5]
Handling event 3 of type 'MouseEventArgs'
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 9 of type QueryParamsMinimalRepo.Client.Shared.LoginDisplay
dbug: Microsoft.AspNetCore.Components.Routing.Router[2]
Navigating to component QueryParamsMinimalRepo.Client.Pages.Authentication in response to path 'authentication/login' with base URI 'https://localhost:7205/'
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 3 of type Microsoft.AspNetCore.Components.Routing.Router
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 4 of type Microsoft.AspNetCore.Components.RouteView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 5 of type Microsoft.AspNetCore.Components.Routing.FocusOnNavigate
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 6 of type Microsoft.AspNetCore.Components.LayoutView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 7 of type QueryParamsMinimalRepo.Client.Shared.MainLayout
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 21 (QueryParamsMinimalRepo.Client.Pages.Authentication) as child of 7 (QueryParamsMinimalRepo.Client.Shared.MainLayout)
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[4]
Disposing component 10 of type QueryParamsMinimalRepo.Client.Pages.Index
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[4]
Disposing component 14 of type Microsoft.AspNetCore.Components.Web.PageTitle
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[4]
Disposing component 15 of type QueryParamsMinimalRepo.Client.Shared.SurveyPrompt
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[4]
Disposing component 16 of type Microsoft.AspNetCore.Components.Sections.SectionContent
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 21 of type QueryParamsMinimalRepo.Client.Pages.Authentication
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
Initializing component 22 (Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorView) as child of 21 (QueryParamsMinimalRepo.Client.Pages.Authentication)
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore[1]
Processing action login.
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore[16]
Login request '{"ReturnUrl":"https://localhost:7205/","Scopes":null,"Interaction":"SignIn","AdditionalRequestParameters":{"tenant":"Test-Tenant"}}'.
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
signIn: {"url":null,"state":{"returnUrl":"https://localhost:7205/"},"interactiveRequest":{"returnUrl":"https://localhost:7205/","scopes":null,"interaction":"SignIn","additionalRequestParameters":{"tenant":"Test-Tenant"}}}
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
signIn-Request: {"redirectUri":"https://localhost:7205/authentication/login-callback","state":"2108809b-cc87-4062-a790-4fdf16fee7c7","tenant":"Test-Tenant","scopes":["openid","profile","https://template.onmicrosoft.com/some-id/APIAccess"]}
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
Starting sign-in redirect.
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Verbose - loginRedirect called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Verbose - acquireTokenRedirect called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Verbose - preflightBrowserEnvironmentCheck started
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Verbose - preflightInteractiveRequest called, validating app environment
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Verbose - getAllAccounts called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Info - Emitting event: msal:loginStart
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - initializeAuthorizationRequest called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - getRedirectUri called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - Initializing BaseAuthRequest
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 18 of type Microsoft.AspNetCore.Components.Sections.SectionOutlet
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 22 of type Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorView
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 11 of type Microsoft.AspNetCore.Components.Routing.NavLink
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - No active account filters cache schema found, looking for legacy schema
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - No active account found
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.getTemporaryCache: No cache item found in local storage
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.updateCacheEntries called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:43 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - initializeServerTelemetryManager called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - initializeAuthorizationRequest called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - getClientConfiguration called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - getDiscoveredAuthority called
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Trace - PerformanceClient: Performance measurement started for standardInteractionClientGetDiscoveredAuthority
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Trace - PerformanceClient: Performance measurement for standardInteractionClientGetDiscoveredAuthority started
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - Creating discovered authority with configured authority
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.setAuthorityMetadata called
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Trace - PerformanceClient: Performance measurement ended for standardInteractionClientGetDiscoveredAuthority: 368.40000000037253 ms
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : @azure/[email protected] : Trace - PerformanceClient: Performance measurement for standardInteractionClientGetDiscoveredAuthority added/updated
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - Auth code client created
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Trace - isNativeAvailable called
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Trace - isNativeAvailable: allowNativeBroker is not enabled, returning false
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - RedirectHandler.initiateAuthRequest called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : @azure/[email protected] : Trace - BrowserCacheManager.cacheCodeRequest called
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
[Tue, 09 May 2023 13:55:44 GMT] : [88eec65f-02aa-4506-bd5a-291167d7c089] : [email protected] : Verbose - RedirectHandler.initiateAuthRequest: Navigating window to navigate url
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
Navigating to https://template.b2clogin.com/some-id/b2c_1a_signin/oauth2/v2.0/authorize?client_id=some-client-id&scope=openid%20profile%20https%3A%2F%2Ftemplate.onmicrosoft.com%2Fsome-id%2FAPIAccess%20offline_access&redirect_uri=https%3A%2F%2Flocalhost%3A7205%2Fauthentication%2Flogin-callback&client-request-id=some-id&response_mode=fragment&response_type=code&x-client-SKU=msal.js.browser&x-client-VER=2.28.3&client_info=1&code_challenge=84VvwT9DzFJvCAWNPqrwvO9ESWjTGaVN4v33ypnL20I&code_challenge_method=S256&nonce=44a5f584-a42c-4293-b907-ae739f51281f&state=eyJpZCI6ImQ3YWI5ZWNmLWZlYzAtNGEyMC05MmUzLTAzNGFjOGYxZjcyYiIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicmVkaXJlY3QifX0%3D%7C2108809b-cc87-4062-a790-4fdf16fee7c7
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
signIn-Response: undefined
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore[3]
Login requires redirect to the identity provider.
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
Rendering component 22 of type Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorView
crbug/1173575, non-JS module files deprecated.
The thread 0x2ce4 has exited with code 0 (0x0).
The thread 0x4f60 has exited with code 0 (0x0).
The thread 0x4e00 has exited with code 0 (0x0).
The thread 0x0 has exited with code 0 (0x0).
The program 'localhost:7205' has exited with code 4294967295 (0xffffffff).
The program '' has exited with code 4294967295 (0xffffffff).
The program '[17928] QueryParamsMinimalRepo.Server.exe' has exited with code 4294967295 (0xffffffff).

I only removed some identifying information such as client ids and the name of my b2c directory.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 9, 2023
@javiercn
Copy link
Member

javiercn commented May 9, 2023

Processing action login.
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore[16]
Login request '{"ReturnUrl":"https://localhost:7205/","Scopes":null,"Interaction":"SignIn","AdditionalRequestParameters":{"tenant":"Test-Tenant"}}'.
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
signIn: {"url":null,"state":{"returnUrl":"https://localhost:7205/"},"interactiveRequest":{"returnUrl":"https://localhost:7205/","scopes":null,"interaction":"SignIn","additionalRequestParameters":{"tenant":"Test-Tenant"}}}
trce: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
signIn-Request: {"redirectUri":"https://localhost:7205/authentication/login-callback","state":"2108809b-cc87-4062-a790-4fdf16fee7c7","tenant":"Test-Tenant","scopes":["openid","profile","https://template.onmicrosoft.com/some-id/APIAccess"]}
dbug: Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService[0]
Starting sign-in redirect.

That's the exact request object being passed to msal.js. It seems that it contains the information that you were passing. Does that match the shape that msal.js expects?

@javiercn javiercn added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels May 9, 2023
@ghost
Copy link

ghost commented May 9, 2023

Hi @jlavery416. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jlavery416
Copy link
Author

@javiercn

Maybe I've misunderstood the expected behavior. I thought that the query parameters I added to my request options would be automatically added as query parameters to the authorize request. Is there some configuration with respect to msal.js I'm missing?

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 9, 2023
@javiercn
Copy link
Member

javiercn commented May 9, 2023

@jlavery416 we only pass through the additional parameters to the underlying object, but you are still responsible for ensuring the underlying object has the right shape that msal.js expects.

@jlavery416
Copy link
Author

@javiercn Thanks for the help! I think I understand now.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Projects
None yet
Development

No branches or pull requests

2 participants