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

Latest Xamarin.Auth installs "Xamarin.Auth.CustomUrlSchemeCallbackActivity" on Android #150

Closed
fekberg opened this issue Mar 2, 2017 · 3 comments

Comments

@fekberg
Copy link

fekberg commented Mar 2, 2017

Updated to latest Xamarin.Auth, 1.3.2.2, and when the app installs it also installs something else: Xamarin.Auth.CustomUrlSchemeCallbackActivity.

How do I get rid of this, and why does it install at all?

@moljac

This comment has been minimized.

Copy link
Member

moljac commented Mar 3, 2017

Yes, it does install and it will install in the future.

My mistake, my bad (mea maxima/magna culpa) that I pushed some code by accident. I was working on fixing Windows issues (UWP and WinRT Win and WP), so I committed few files that are about to come in next weeks.

I will fix those and repackage nuget and publish 1.3.2.4 ASAP (till 23:59 CET). Please test it and report it here please.

How can user get rid of this? Only downgrade.

Why? Because on 2017-04-20 Xamarin.Auth as is will not be able to login with google and most of other OAuth providers. See details below please.

There are 2 reasons (2 new features coming):

  1. new non-embeded-browser (WebView and UIVwebView) are coming ([Chrome]CustomTabs and SFSafariViewController) called Native UI Logins.
  2. Xamarin.Auth could never deal with urls in this form (which are intended for mobile):
    https://forums.xamarin.com/discussion/5866/xamarin-auth-and-infinite-error-alerts
    • urn:ietf:wg:oauth:2.0:oob
    • http[s]://127.0.0.1
    • http[s]:://localhost

So, these are major fixes coming up.

This is breaking change for new feature using Native UI instead of embedded web browser
controls/widgets/views.

|--------------------|--------------------|------------------------------|
| OS | Old/deprecated | new/secure |
| | embedded browsers | Native UI |
|--------------------|--------------------|------------------------------|
| Android | WebView | [Chrome] Custom Tabs |
| iOS | UIWebView | SFSafariViewController |
|--------------------|--------------------|------------------------------|

New flag in Authenticator class

IsUsingNativeUI

https://github.com/xamarin/Xamarin.Auth/blob/portable-bait-and-switch/samples/Traditional.Standard/references01projects/Providers/Xamarin.Auth.Sample.XamarinIOS/TestProvidersController.cs#L92-L103

https://github.com/xamarin/Xamarin.Auth/blob/portable-bait-and-switch/samples/Traditional.Standard/references01projects/Providers/Xamarin.Auth.Sample.XamarinAndroid/MainActivity.cs#L83-L96

Android

System.Object ui_intent_as_object = auth.GetUI(this);
if (auth.IsUsingNativeUI == true)
{
    // Add Android.Support.CustomTabs package 
    global::Android.Support.CustomTabs.CustomTabsIntent cti = null;
    cti = (global::Android.Support.CustomTabs.CustomTabsIntent)ui_intent_as_object;

}
else 
{
    global::Android.Content.Intent i = null;
    i = (global::Android.Content.Intent)ui_intent_as_object;
    StartActivity(i);
}

IOS

System.Object ui_controller_as_object = auth.GetUI();
if (auth.IsUsingNativeUI == true)
{
    SafariServices.SFSafariViewController c = null;
    c = (SafariServices.SFSafariViewController) ui_controller_as_object;
    PresentViewController (c, true, null);
}
else
{
    UIViewController c = (UIViewController)ui_controller_as_object;
    PresentViewController (c, true, null);
}

Details for No.1.:

https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

On 2016-10-20, Google did prevent new OAuth clients (for new apps created on
backends - new API keys) from using web views, and did start presenting users
with warnings of the end-of-life schedule.

On 2017-04-20 web views will get blocked unless there's no viable alternative.

OAuth1 officially deprecated

https://developers.google.com/accounts/docs/RegistrationForWebAppsAuto
https://developers.google.com/identity/sign-in/auth-migration

ClientLogin officially deprecated

https://developers.google.com/identity/protocols/AuthForInstalledApps

https://www.theregister.co.uk/2016/08/23/google_to_block_web_views_from_using_its_oauth/

@moljac

This comment has been minimized.

Copy link
Member

moljac commented Mar 5, 2017

Nuget v. 1.3.2.4 published few minutes ago. Please test it and report any issues (even better if issues are fixed).
NOTE: new nuget with UWP and WinRT fixes is on the way.

@moljac

This comment has been minimized.

Copy link
Member

moljac commented May 25, 2017

1.5.0 is published with Native UI and Xamarin.Forms support
Closing

@moljac moljac closed this May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.