microsoft-authentication-library-for-dotnet icon indicating copy to clipboard operation
microsoft-authentication-library-for-dotnet copied to clipboard

[Bug] Browser window not closed - MAUI Android

Open Pmr-precure opened this issue 1 year ago • 9 comments

Library version used

4.60.1

.NET version

MAUI .net 8

Scenario

PublicClient - mobile app

Is this a new or an existing app?

This is a new app or experiment

Issue description and reproduction steps

After a successful login the browser keeps running with the login screen on.

I tested it my own project and in the MAUI samples project, same happens.

We have a Xamarin app that we are moving to MAUI, and here the browser closes after login.

image

Relevant code snippets

No response

Expected behavior

Browser/Tab should close after login

Identity provider

Azure B2C Custom Policy

Regression

No response

Solution and workarounds

No work arounds found.

Pmr-precure avatar Apr 03 '24 09:04 Pmr-precure

@Pmr-precure - and you're using the system browser API, I am assuming?

localden avatar Apr 03 '24 20:04 localden

Yes and tested it on multiple devices, both running Android 13 though.

Pmr-precure avatar Apr 03 '24 20:04 Pmr-precure

No one else has this issue?

Pmr-precure avatar Apr 09 '24 08:04 Pmr-precure

@Pmr-precure - I will need to test this to verify the scenario. Thank you for the feedback, I will follow-up on this issue.

localden avatar Apr 12 '24 16:04 localden

@Pmr-precure - I will need to test this to verify the scenario. Thank you for the feedback, I will follow-up on this issue.

Did you have time to look at it? :) we are still facing this issue. BR

Pmr-precure avatar May 07 '24 17:05 Pmr-precure

@Pmr-precure also to confirm - this only happens for Azure B2C and not for Entra ID?

localden avatar May 19 '24 02:05 localden

@Pmr-precure also to confirm - this only happens for Azure B2C and not for Entra ID?

To be honest im not sure about the difference. We use a Azure b2c sign in only policy. Not custom. It works fine in our xamarin app. But in Maui it doesnt close the browser window after a login. BR

Pmr-precure avatar May 19 '24 05:05 Pmr-precure

There is an AuthenticationContinuationHelper class which is supposed to be notified of when the browser flow finishes. It's in your code. Does this get hit at all?

bgavrilMS avatar May 20 '24 08:05 bgavrilMS

There is an AuthenticationContinuationHelper class which is supposed to be notified of when the browser flow finishes. It's in your code. Does this get hit at all?

Okay i just tested on my Pixel 8 and an Emulator, it does trigger and call AuthenticationContinuationHelper. But it still doesnt close the brower window.

Pmr-precure avatar May 21 '24 06:05 Pmr-precure

Finally break through! I was missing this: image In my manifest

Pmr-precure avatar Jun 03 '24 10:06 Pmr-precure

Thx for following up @Pmr-precure !

bgavrilMS avatar Jun 03 '24 13:06 bgavrilMS