3

So I've successfully implemented Xamarin.Auth for Google login using this as a guide:

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

Now, trying to implement the same thing for LinkedIn, for some reason the custom URL interceptor (for deep linking), doesn't catch the redirect URI?

I've set "https://www.linkedin.com/oauth-success" to be my redirect URI on linkedin's app console, and am using it for the Xamarin.Auth's authenticator. It successfully opens up the native UI browser and loads the LinkedIn login page, but once the user logs in, they get left on the LinkedIn website, instead of routed back to the app.

Here is my custom url scheme interceptor code:

    [Activity(Label = "ActivityCustomUrlSchemeInterceptor")]
[
    IntentFilter
    (
        actions: new[] { Intent.ActionView },
        Categories = new[]
                {
                    Intent.CategoryDefault,
                    Intent.CategoryBrowsable
                },
        DataSchemes = new[]
                {
                    "Sybrin.Mobile.OnBoarding.Droid.Sybrin.Mobile.OnBoarding.Droid",
                    "com.googleusercontent.apps.649780690715-0kajj7q0kgf40mc2fpct709cehgnei16",
                    "xamarin-auth",
                    "https://localhost",
                    "https",

                },
        DataHosts = new[]
        {
            "localhost",
            "authorize",
            "www.linkedin.com"
        },
        DataPaths = new[]
        {
            "/oauth2redirect",
            "/oauth-success"
        },
        AutoVerify = true
    )
]

Interestingly, when the intent-filter is like that, Google's deep linking breaks, but when I comment out the DataHosts, google successfully routes back into the app after login.

I hope I've been clear. Any help will be greatly appreciated.

Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105

0 Answers0