-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Comments
@jlavery416 thanks for contacting us. Can you turn logging to debug/trace level as described here and check the logs in the console? |
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. |
@javiercn Here are the logs you requested: I only removed some identifying information such as client ids and the name of my b2c directory. |
Processing action login. 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? |
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. |
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? |
@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. |
@javiercn Thanks for the help! I think I understand now. |
Is there an existing issue for this?
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
The text was updated successfully, but these errors were encountered: