Exemplo n.º 1
0
 public ClientAuthenticationController(
     IClientAuthentication clientAuthentication,
     IOptions <AppSettings> appSettings)
 {
     _clientAuthentication = clientAuthentication;
     _appSettings          = appSettings.Value;
 }
Exemplo n.º 2
0
        public Task <TokenResponse> PerformTokenRequestAsync(TokenRequest request, IClientAuthentication clientAuthentication)
        {
            var tcs = new TaskCompletionSource <TokenResponse>();

            PerformTokenRequest(request, clientAuthentication, (resp, ex) =>
            {
                if (ex != null)
                {
                    tcs.SetException(ex);
                }
                else
                {
                    tcs.SetResult(resp);
                }
            });

            return(tcs.Task);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a means of connecting to a <see cref="CtpServer"/>.
 /// </summary>
 /// <param name="host">The host IP</param>
 /// <param name="authentication">The authentication ticket to use. Specify null to not use SSL.</param>
 public CtpClient(IPEndPoint host, IClientAuthentication authentication = null)
 {
     m_remoteEndpoint = host;
     m_authentication = authentication ?? new ClientAuthenticationNone();
 }
Exemplo n.º 4
0
 public void PerformTokenRequest(TokenRequest request, IClientAuthentication clientAuthentication, Action <TokenResponse, AuthorizationException> callback)
 {
     PerformTokenRequest(request, clientAuthentication, new TokenResponseCallback(callback));
 }
Exemplo n.º 5
0
 private void Act()
 {
     _actual = _serviceFactory.CreateClientAuthentication();
 }
Exemplo n.º 6
0
 public void Configure(string hostKey, IClientAuthentication clientAuthentication = null)
 {
     hostConfig = configurator.GetHost(hostKey);
     authorizer = clientAuthentication;
 }