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

in app browser: sign in loads indefinitely #101

Closed
Venipa opened this issue Sep 1, 2020 · 13 comments
Closed

in app browser: sign in loads indefinitely #101

Venipa opened this issue Sep 1, 2020 · 13 comments

Comments

@Venipa
Copy link

Venipa commented Sep 1, 2020

MSAL generated deep link url (provided from azures generated mobile auth preset):
image

AzureAuth init:
image

Sign in loading...:
image

@Venipa
Copy link
Author

Venipa commented Sep 1, 2020

according to remote devtools it seems that the navigation is getting blocked:
image

@vmurin
Copy link
Owner

vmurin commented Sep 5, 2020

Hi,
sorry for the delay with the answer.

It's a typical error if the registered callback URL does not correspond to one in AndroidManifest.xml

You could check the issue #6

And I really recommend first to follow the URL scheme from README and remove all other <data /> entries from manifest.
Check if it works in this configuration and then add other entries if you need it for some reason.

You could also check the sample app and just register some test application in Azure Portal with exactly the sample callback URL

@Venipa
Copy link
Author

Venipa commented Sep 5, 2020

Hi,
sorry for the delay with the answer.

It's a typical error if the registered callback URL does not correspond to one in AndroidManifest.xml

You could check the issue #6

And I really recommend first to follow the URL scheme from README and remove all other <data /> entries from manifest.
Check if it works in this configuration and then add other entries if you need it for some reason.

You could also check the sample app and just register some test application in Azure Portal with exactly the sample callback URL

the callback url does correspond to one in AndroidManifest.xml

i've tried to load such callback via adb shell and it worked, please look into my second comment which also shows the issue after calling the custom scheme @vmurin

@vmurin
Copy link
Owner

vmurin commented Sep 6, 2020

At time as you are putting in the password in browser and the app should be called back - there is no any library code involved.
Via adb you are using one URL, and what uses Azure on login - it's another thing. If your app does not pop up on callback, it means that the Azure server calls something not registered in AndroidManifest.
That's why my advise was - remove any other callback URLs in the manifest and in the app registration. And as I wrote - the simplest way is to check out sample app and register it with one callback to see whether it works

I'm looking forward to your feedback :)

@Venipa
Copy link
Author

Venipa commented Sep 6, 2020

according to remote devtools it seems that the navigation is getting blocked:
image

please look into my previous comments @vmurin ...
i've tried every custom scheme provided in the AndroidManifest.xml
these schemes are blocked.

@vmurin
Copy link
Owner

vmurin commented Sep 6, 2020

please look into my previous comment - I explained, that it can not has to do with library.
And I cannot see in you comments that you tried anything that I proposed to. ;)

If you are asking for an advise:

  • just try the simplest possible configuration on both sides - manifest and app registration - only 1 URL.
  • I don't have any clue where this "navigation blocked" comes from. And also I'm not sure that the error message in this case means exactly wat it says... it could be some side effect - so I would try another clean copy of android emulator, perhaps another version.

Sorry, I can't propose any other suggestion about your issue. The library is downloaded about 800 times a week - and it just works. Your should definitely have some configuration issue. Just give a try for my suggestions above :-)

@Venipa
Copy link
Author

Venipa commented Sep 6, 2020

please look into my previous comment - I explained, that it can not has to do with library.
And I cannot see in you comments that you tried anything that I proposed to. ;)

If you are asking for an advise:

  • just try the simplest possible configuration on both sides - manifest and app registration - only 1 URL.
  • I don't have any clue where this "navigation blocked" comes from. And also I'm not sure that the error message in this case means exactly wat it says... it could be some side effect - so I would try another clean copy of android emulator, perhaps another version.

Sorry, I can't propose any other suggestion about your issue. The library is downloaded about 800 times a week - and it just works. Your should definitely have some configuration issue. Just give a try for my suggestions above :-)

Pt 2. This issue comes from a real device, the error popped up in a chromium browser. Probably one of the new security updates.

@vmurin
Copy link
Owner

vmurin commented Sep 6, 2020

Oh, it's an important addition. Does it works on emulator?
What android and chrome version you are using?

@Venipa
Copy link
Author

Venipa commented Sep 6, 2020

Oh, it's an important addition. Does it works on emulator?

I've also tried it on an android emulator with google play services (same issues).
Android 10 (both emulator and real device)
Chrome 85.0+, Firefox 80.1.2+ and Edge 45.07

@vmurin
Copy link
Owner

vmurin commented Sep 6, 2020

Some suggestion:
https://developer.android.com/training/app-links/deep-linking#adding-filters
Quote from here:

Notice that the two intent filters only differ by the element. Although it's possible to include multiple elements in the same filter, it's important that you create separate filters when your intention is to declare unique URLs (such as a specific combination of scheme and host), because multiple elements in the same intent filter are actually merged together to account for all variations of their combined attributes.

It could be that multiple data elements create some combination that is blocked then by browser. Have you tested the behavior with only one callback ULR == one data elemen in the intent-fliter? try it.

@Venipa
Copy link
Author

Venipa commented Sep 6, 2020

Some suggestion:
https://developer.android.com/training/app-links/deep-linking#adding-filters
Quote from here:

Notice that the two intent filters only differ by the element. Although it's possible to include multiple elements in the same filter, it's important that you create separate filters when your intention is to declare unique URLs (such as a specific combination of scheme and host), because multiple elements in the same intent filter are actually merged together to account for all variations of their combined attributes.

It could be that multiple data elements create some combination that is blocked then by browser. Have you tested the behavior with only one callback ULR == one data elemen in the intent-fliter? try it.

I'm trying it asap and respond with the result

edit:
i've tried it now but it does not seem to work... same issue. @vmurin

@Venipa
Copy link
Author

Venipa commented Sep 9, 2020

this has been fixed by adding the package name as "android:label" attribute to the intent filter (thanks to microsoft support)

@Venipa Venipa closed this as completed Sep 9, 2020
@vmurin
Copy link
Owner

vmurin commented Sep 9, 2020

this has been fixed by adding the package name as "android:label" attribute to the intent filter (thanks to microsoft support)

Thank you very much for your feedback.
I didn't have time to write you yesterday - I have tested the flow within your environment (Android 10 + Chrome 85) and it worked as intended. :)

Actually I can't imagine that label can have any impact on functionality. May be you have changed something else during your bug-hunt?
I thought - the one more possible problem could be some not allowed character in scheme. See Note 2 in this section

And for the case if someone else has a similar issue could you please post here you manifest example as a reference.
Thank you in advance!

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

No branches or pull requests

2 participants