Ejemplo n.º 1
0
        private void CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
        {
            var def = args.GetDeferral();

            if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk)
            {
                args.Credentials.PasswordCredential.Password = _ajOnboardingConfig.presharedKey;
            }

            def.Complete();
        }
 private void AlljoynBusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
 {
     if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk)
     {
         args.Credentials.PasswordCredential.Password = m_key;
     }
     else
     {
         UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
     }
 }
        private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
        {
            Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();
            m_isCredentialsRequested = true;

            if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk)
            {
                m_authenticateClicked = new TaskCompletionSource<bool>();
                AuthenticationVisibility = Visibility.Visible;

                UpdateStatusAsync("Please enter the key.", NotifyType.StatusMessage);
                await m_authenticateClicked.Task;
                m_authenticateClicked = null;

                if (!String.IsNullOrEmpty(m_key))
                {
                    args.Credentials.PasswordCredential.Password = m_key;
                }
                else
                {
                    UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
                }
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }

            credentialsDeferral.Complete();
        }
Ejemplo n.º 4
0
 private void Bus_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
 {
     Debug.WriteLine("Bus_CredentialsRequested");
 }
 private void AlljoynBusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
 {
     if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk)
     {
         args.Credentials.PasswordCredential.Password = m_key;
     }
     else
     {
         UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
     }
 }
Ejemplo n.º 6
0
        private async void BusAttachment_CredentialsRequested(AllJoynBusAttachment sender, AllJoynCredentialsRequestedEventArgs args)
        {
            Windows.Foundation.Deferral credentialsDeferral = args.GetDeferral();

            if ((args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdhePsk) ||
                (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheSpeke))
            {
                m_authenticateClicked    = new TaskCompletionSource <bool>();
                AuthenticationVisibility = Visibility.Visible;

                UpdateStatusAsync("Please enter the key.", NotifyType.StatusMessage);
                await m_authenticateClicked.Task;
                m_authenticateClicked = null;

                if (!string.IsNullOrEmpty(m_key))
                {
                    args.Credentials.PasswordCredential.Password = m_key;
                }
                else
                {
                    UpdateStatusAsync("Please enter a key.", NotifyType.ErrorMessage);
                }
            }
            else if (args.Credentials.AuthenticationMechanism == AllJoynAuthenticationMechanism.EcdheNull)
            {
            }
            else
            {
                UpdateStatusAsync("Unexpected authentication mechanism.", NotifyType.ErrorMessage);
            }

            credentialsDeferral.Complete();
        }