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

Add 'haschrome=1' to avoid unexpected back buttons on the first page. #4836

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

fengga
Copy link
Contributor

@fengga fengga commented Jul 10, 2024

https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2972166

Fixes #4738

Changes proposed in this request

It's very easy to reproduce (need to add login hint in the test app code first) the back button by:
image

In MSAL C++, interactively calls always add "haschrome=1" to avoid such kind of unexpected back buttons on the first page, and this way is also recommended by ESTS folks.
https://github.com/AzureAD/microsoft-authentication-library-for-cpp/blob/4fa774db2b38cdce9c9b94e3e686ab53fc24b948/source/xplat/requests/WebRequestManager.cpp#L566

After adding "haschrome=1" the issue can be resolved:
image

Testing

Performance impact

Documentation

  • All relevant documentation is updated.

@fengga fengga requested a review from a team as a code owner July 10, 2024 21:18
@bgavrilMS
Copy link
Member

Nice fix @fengga . Just see that a few unit tests need to be updated.

@rayluo
Copy link
Contributor

rayluo commented Jul 11, 2024

In MSAL C++, interactively calls always add "haschrome=1" to avoid such kind of unexpected back buttons on the first page, and this way is also recommended by ESTS folks.

Intriguing finding. It feels like folklore because even the name of that workaround - "haschrome" - does not make much sense. :-)

On a more serious note, the current feature branch name is "fixEmbeddedbrowser", however, now I realize that the same mysterious Back-button behavior also applies to Firefox as system browser: it shows up by default, and disappears when using haschrome=1. But I am not aware of other complain, presumably because that default Back button is understandably perceived as a Cancel. So, I suppose we do not have to propagate this change to all other MSALs, do we?

@fengga fengga merged commit df47013 into main Jul 15, 2024
6 checks passed
@fengga fengga deleted the fengga/fixEmbeddedbrowserBackButton branch July 15, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] "Back" button appears in MSAL.net (which was not appearing in ADAL.net)
4 participants