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

Blazor Azure ADB2C Authentication popup size does not match content #37365

Closed
Tracked by #26364
ahawes-clarity opened this issue Oct 7, 2021 · 5 comments
Closed
Tracked by #26364
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth
Milestone

Comments

@ahawes-clarity
Copy link

The default authentication popup when using Azure ADB2C Authentication does not account for additional "Sign in with social account" options.

image

I also was not able to find any documentation that would provide a way to control the size of the popup window.

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Oct 7, 2021
@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Oct 12, 2021
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Oct 12, 2021
@ghost
Copy link

ghost commented Oct 12, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ahawes-clarity
Copy link
Author

Until this bug is addressed, are there any workarounds short of creating a custom login template?

@javiercn
Copy link
Member

javiercn commented Nov 2, 2021

@ahawes-clarity thanks for contacting us.

This is something that MSAL exposes (here) but we don't in our wrappers. You can create your own AuthenticationService.js and configure the settings there directly.

@ahawes-clarity
Copy link
Author

ahawes-clarity commented Nov 2, 2021

@javiercn thanks for the info. I was able to make a copy of the AuthenticationService.js file which was referenced in my index.html. I changed the reference to point to my copy and then changed the height value for the popup window. I realize that this is just a workaround and that if I update the version of MSAL I may need to redo this but it gives me what I need to solve the problem without too much work.

For others that might need to do this:

Here are my changes to index.html where WorkaroundAuthenticationService.js is a copy of AuthenticationService.js:

    <!--<script src="_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js"></script>-->
    <script src="js/WorkaroundAuthenticationService.js"></script>

I then updated WorkaroundAuthenticationService.js to set the popup height and width. The js file is minified so I had to do some searching and referencing of the TypeScript source to find what I needed.

Search for:
ir="interaction_in_progress",sr="invalid_grant",ar=483,cr=600,ur=50,dr="msal.js.browser";

It may be possible that yours differs based on what the minifier does but this should be enough info for you to find the code in your file.

In my case ar was width and cr was height.

Change the values as needed.

@javiercn
Copy link
Member

This should be possible with the new additional parameters support coming in RC1

@javiercn javiercn modified the milestones: Backlog, 7.0-rc1 Aug 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-wasm-auth
Projects
None yet
Development

No branches or pull requests

3 participants