Exemplo n.º 1
0
        async Task ExecuteSignInCommand()
        {
            // NEW Client ID: 409009394217-p3cu602apd7vkaucmg4p1vijhqm4is6f.apps.googleusercontent.com
            // OLD Client ID: 409009394217-11dcm7db57c38qp5q47jj4p8gfmi88p1.apps.googleusercontent.com
            await _authService.SignInAsync(
                tokenCallback : async t =>
            {
                // use google token to get Azure auth token
                var response = await _tripLogService.GetAuthTokenAsync("google", t);

                // save auth token in local settings
                Helpers.Settings.TripLogApiAuthToken = response.AuthenticationToken;

                // Navigate to Main
                await NavService.NavigateTo <MainViewModel>();
                await NavService.RemoveLastView();
            },
                errorCallback : e =>
            {
                // todo: handle invalid auth here
            });
        }
        async Task ExecuteSignInCommand()
        {
            // TODO: Update with your Facebook Client Id
            await _authService.SignInAsync("YOUR-FACEBOOK-CLIENTID",
                                           new Uri("https://m.facebook.com/dialog/oauth"),
                                           new Uri("https://<your-service-name>.azurewebsites.net/.auth/login/facebook/callback"),
                                           tokenCallback : async t =>
            {
                // Use Facebook token to get Azure auth token
                var response = await _tripLogService.GetAuthTokenAsync("facebook", t);

                // Save auth token in local settings
                Helpers.Settings.TripLogApiAuthToken = response.AuthenticationToken;

                // Navigate to Main
                await NavService.NavigateTo <MainViewModel>();
                await NavService.RemoveLastView();
            },
                                           errorCallback : e =>
            {
                // TODO: Handle invalid authentication here
            });
        }