public override void Launch(IAuthenticator authenticator, AuthenticationInitMethod authenticationInitMethod)
 {
     if (authenticationInitMethod.Equals(AuthenticationInitMethod.SignInButton))
     {
         Launch(authenticator, AuthenticationMode.Eager);
     }
     else
     {
         Launch(authenticator, AuthenticationMode.Lazy);
     }
 }
示例#2
0
        /// <summary>
        /// Launches the application.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="deviceAsset">The device asset.</param>
        /// <returns>PluginExecutionResult</returns>
        private PluginExecutionResult LaunchApp(IDevice device, IDeviceInfo deviceAsset)
        {
            PluginExecutionResult result = new PluginExecutionResult(PluginResult.Passed);
            string buttonText            = _activityData.InitiationButton;

            try
            {
                _workflowLogger.RecordEvent(DeviceWorkflowMarker.ActivityBegin);

                AuthenticationInitMethod aim = GetAuthenticationInitMethod(_activityData.InitiationButton);
                DeviceSignOutMethod      deviceUnauthMethod = SignOutMethod.GetSignOutMethod(_activityData.UnAuthenticateMethod);
                IAuthenticator           auth = GetAuthenticator(device, deviceAsset);

                // retrieve the Authentication solution, plugin.
                IAuthenticationDriver app = GetApp(device);

                UpdateStatus("Launching authentication for " + buttonText + ".");
                if (!aim.Equals(AuthenticationInitMethod.DoNotSignIn))
                {
                    app.Launch(auth, aim);
                }
                else
                {
                    UpdateStatus("Skip Sign In :: Do not Sign In");
                }

                UpdateStatus("Logging out of device " + deviceAsset.AssetId + " - " + deviceAsset.Address + " by " + _activityData.UnAuthenticateMethod);
                if (deviceUnauthMethod.Equals(DeviceSignOutMethod.DoNotSignOut))
                {
                    UpdateStatus("Skip Sign Out :: Do Not Sign Out");
                }
                else
                {
                    app.SignOut(deviceUnauthMethod, device);
                }

                _workflowLogger.RecordEvent(DeviceWorkflowMarker.ActivityEnd);
            }
            catch (DeviceCommunicationException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex.Message, "Device communication error.");
            }
            catch (DeviceInvalidOperationException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex.Message, "Device automation error.");
            }
            catch (DeviceWorkflowException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex, "Device workflow error.");
            }

            return(result);
        }
示例#3
0
        /// <summary>
        /// Launches the Windjammer specified authenticator utilizing the given authentication initialization method.
        /// </summary>
        /// <param name="authenticator">The authenticator.</param>
        /// <param name="authenticationInitMethod">The authentication initialize method.</param>
        /// <exception cref="DeviceWorkflowException">Device Initialization method " + authenticationInitMethod.GetDescription() + " is not supported at this time.</exception>
        public override void Launch(IAuthenticator authenticator, AuthenticationInitMethod authenticationInitMethod)
        {
            authenticator.InitializationMethod = authenticationInitMethod;

            if (authenticationInitMethod.Equals(AuthenticationInitMethod.SignInButton))
            {
                ActivateViaSignIn(authenticator);
            }
            else if (authenticationInitMethod.Equals(AuthenticationInitMethod.ApplicationButton))
            {
                ActivateViaAppButton(authenticator);
            }
            else if (authenticationInitMethod.Equals(AuthenticationInitMethod.Badge))
            {
                Authenticate(authenticator, JediWindjammerLaunchHelper.HOMESCREEN_FORM);
            }
            else
            {
                throw new DeviceWorkflowException("Device Initialization method " + authenticationInitMethod.GetDescription() + " is not supported at this time.");
            }
        }
        public override void Launch(IAuthenticator authenticator, AuthenticationInitMethod authenticationInitMethod)
        {
            authenticator.InitializationMethod = authenticationInitMethod;


            if (authenticationInitMethod.Equals(AuthenticationInitMethod.SignInButton))
            {
                _launchHelper.PressSignInButton();
                Authenticate(authenticator, JediOmniLaunchHelper.SignInOrSignoutButton);
                OnHomeScreen = IsAuthenticated;
            }
            else if (authenticationInitMethod.Equals(AuthenticationInitMethod.ApplicationButton))
            {
                switch (_initMethod)
                {
                case InitiationMethod.Badge:
                    Authenticate(authenticator, JediOmniLaunchHelper.SignInOrSignoutButton);
                    break;

                case InitiationMethod.Copy:
                    CopyLazyAuth(authenticator, _omniDevice);
                    break;

                case InitiationMethod.Email:
                    EmailLazyAuth(authenticator, _omniDevice);
                    break;

                case InitiationMethod.Fax:
                    FaxLazyAuth(authenticator, _omniDevice);
                    break;

                case InitiationMethod.NetworkFolder:
                    NetworkFolderLazyAuth(authenticator, _omniDevice);
                    break;

                case InitiationMethod.WorkFlow:
                    DssWorkflowLazyAuth(authenticator, _omniDevice);
                    break;

                case InitiationMethod.Equitrac:
                case InitiationMethod.HPAC:
                case InitiationMethod.HPCR_PersonalDistributions:
                case InitiationMethod.HPCR_PuplicDistributions:
                case InitiationMethod.HPCR_RoutingSheet:
                case InitiationMethod.HPCR_ScanToMe:
                case InitiationMethod.HPCR_ScanToMyFiles:
                case InitiationMethod.HPEC:
                case InitiationMethod.HPRoam:
                case InitiationMethod.SafeCom:
                    PressSolutionButton();
                    Authenticate(authenticator, JediOmniLaunchHelper.LazySuccessScreen);
                    OnHomeScreen      = false;
                    IsAuthenticated   = true;
                    IsUnAuthenticated = false;
                    break;

                case InitiationMethod.DoNotSignIn:
                    break;

                default:
                    throw new ControlNotFoundException("The '" + _solutionButton + "' is not defined for use by the Authentication plugin at this time..");
                }
            }
            else if (authenticationInitMethod.Equals(AuthenticationInitMethod.Badge))
            {
                Authenticate(authenticator, JediOmniLaunchHelper.SignInOrSignoutButton);
            }
        }