public void LogIn(string url, Action<RequestSecurityTokenResponse> onLoggedIn, Action assumeCancelled, string identityProviderName = null)
        {
            var webAuthController = new AccessControlWebAuthController { RawUrl = url, IdentityProviderName = identityProviderName };

            _messageHub = Mvx.Resolve<IMvxMessenger>();
            _subscriptionToken = _messageHub.Subscribe<RequestTokenMessage>(message =>
            {
                webAuthController.OnCancel();

                if (message.TokenResponse != null)
                    onLoggedIn(message.TokenResponse);
                else
                    assumeCancelled();
            });

            var navControl = new UINavigationController(webAuthController)
            {
                Title = identityProviderName,
                NavigationBarHidden = false,
            };
            webAuthController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Done,
                (sender, args) =>
                {
                    webAuthController.OnCancel();
                    assumeCancelled();
                });

            var modalHost = Mvx.Resolve<IMvxTouchModalHost>();
            modalHost.PresentModalViewController(navControl, true);
        }
 public LoginConnectionDelegate(AccessControlWebAuthController controller)
 {
     _controller = controller;
 }
Esempio n. 3
0
 public LoginConnectionDelegate(AccessControlWebAuthController controller)
 {
     _controller = controller;
 }