Microsoft-authentication-library-for-dotnet: [Feature Request] Upgrade library to use AndroidX

Created on 24 Feb 2020  路  13Comments  路  Source: AzureAD/microsoft-authentication-library-for-dotnet

The official stable NuGet packages for AndroidX have been released.
Could you please upgrade the msal lib to use AndroidX?

More information from xamarin here:
https://devblogs.microsoft.com/xamarin/xamarin-forms-xamarin-essentials-go-androidx/

@jennyf19 has kindly listed some scenarios that we should test:

  • [x] Android 9 + interactive/silent auth

    • [x] Embedded webview

    • [x] System browser

  • [x] Android 10 + interactive/silent auth

    • [x] Embedded webview

    • [x] System browser

  • [x] Broker Android 9 + interactive/silent auth
  • [x] Broker Android 10 + interactive/silent auth
  • [x] Create a Xamarin Android app from scratch w/new package

    • [x] Embedded webview

    • [x] System browser

  • [ ] Update Xamarin samples

    • [ ] [B2C Xamarin](https://github.com/Azure-Samples/active-directory-b2c-xamarin-native)

    • [ ] [Xamarin](https://github.com/Azure-Samples/active-directory-xamarin-native-v2)

  • [ ] Send the build to a few customers who are interested in testing before official release
Feature Request enhancement Mobile-Android

Most helpful comment

I have put in the PR for this for Option 1. It will need some test heads to be generated for Android 10, which is think wouldn't be too hard as they are just shim head projects.

Look at the SDK I think an issue will arise if a developer targets Android 10 today using the AndroidX migration package. It will upgrade your library automatically at build time to use AndroidX, however there is a hardcoded string for the CustomTabsService. This will cause a failure point as there isn't a possible way for the migrator to auto update it.

@redth and @mattleibow to validate my work here

All 13 comments

This seems to be the official recommendation from the Xamarin team. All Xamarin libraries should support this.

It is not clear to me if the upgrade won't break backwards compatibility and also how keeping this version (i.e. not upgrading to AndroidX) affects applications. @tranb3r - what is your opinion on this?

My opinion is that:

  • most developers are eager to migrate to androidx asap
  • backwards compatibility should not be a major issue, assuming you follow the recommendations and add a new target for android10 (with androidx) while keeping the existing android9 target (with support libs).

Anyway, I'd rather ask @redth and @jamesmontemagno for their opinion !

Our recommendation is to use AndroidX when compile mode is set to Android 10. All AndroidX packages use the migration so they can work side-by-side existing libraries that haven't updated. Mostly this will help when developers are using Xamarin.Forms and Xamarin.Essentials so eventually over time Support Libs will fade away.

Any progress ?

So this involves providing support for android10 framework. We are currently on android9. There are 2 ways of doing this:

  1. Add a new target to MSAL (preferred)

PROS: backwards compatibility
CONS: difficult to maintain 2 different android versions (we'd need to run 2 sets of tests etc.)

  1. Replace android9 with android10

PROS: easier to maintain
CONS: not backwards compatible

I don't think this is will be done in the next 3 months as we're locking down which new features we commit to.

CC @henrik-me @jmprieur

I have put in the PR for this for Option 1. It will need some test heads to be generated for Android 10, which is think wouldn't be too hard as they are just shim head projects.

Look at the SDK I think an issue will arise if a developer targets Android 10 today using the AndroidX migration package. It will upgrade your library automatically at build time to use AndroidX, however there is a hardcoded string for the CustomTabsService. This will cause a failure point as there isn't a possible way for the migrator to auto update it.

@redth and @mattleibow to validate my work here

@neha-bhargava tested this and it looks like the system browser does not execute. We need to investigate and fix this. It is not ready to merge.

Is it that Chrome Custom Tabs doesn't open? or an embedded browser?

Should be fixed up, basically ADAL does a check to see if anything can open a custom tab and if not then don't do anything. We have to use the older check.

Chrome Custom tabs doesn't open.

Try my latest PR updates.

I merged the PR and added @jennyf19's tests to the issue description.

Resolved in 4.15

Was this page helpful?
0 / 5 - 0 ratings