xamarin / Xamarin.Social

Xamarin.Social
Apache License 2.0
124 stars 74 forks source link

Add facade for authorization via browser (e.g. Safari) #15

Closed gaearon closed 8 years ago

gaearon commented 11 years ago

This commit adds facade for authentication via system browser instead of presenting a modal view controller. It includes a working iOS implementation called SafariUrlHandler. Android clients can implement ICustomUrlHandler in their code.

This pull request depends on this PR merged in Xamarin.Auth:

https://github.com/xamarin/Xamarin.Auth/pull/31

and this into Xamarin.Social:

https://github.com/xamarin/Xamarin.Social/pull/14

Rationale: we noticed that a lot of people are already logged into Twitter/Facebook in Safari but don't remember / care to enter their passwords when presented with a modal form.

By using this method, we can just take them to Safari, where they are logged in, and then take them back into the app, while reusing WebRedirectAuthenticator logic.

Commit licensed under MIT/X11

ermau commented 11 years ago

Have you looked into at all how this might be done on Windows Phone or WinRT?

gaearon commented 11 years ago

@ermau I suppose you could do that with LaunchUriAsync and UriMapper.

ermau commented 11 years ago

@ermau I suppose you could do that with LaunchUriAsync and UriMapper.

UriMapper is only for Windows Phone 8, WP7 has to be supported.

ermau commented 11 years ago

To be clearer, it's better if we can find a way that supports WP7. I don't think not having complete platform support will block this, but we should strive for it if possible.

gaearon commented 10 years ago

@ermau

Since I'm not WP7 guy so I can't really comment on this. My personal pain is that we have to maintain our fork of Xam.Auth and Xam.Social (mostly) because of this feature.

Android doesn't have native login, but we can have Twitter5Service (and hopefully OSSocialService I just re-submitted), right? I don't see any harm in merging a production-tested implementation that works on iOS and can be implemented on Android (perhaps will be—@kobynet is helping me out), and can be implemented on WP8.

After all, this is a mere interface.

What do you reckon?