Example #1
0
 void IDisposable.Dispose()
 {
     _authenticator.Disconnected -= OnNetworkDisconnected;
     FreeState();
     _sessionConfig = null;
     GC.SuppressFinalize(this);
 }
Example #2
0
        public static async Task <AuthClient> InitSessionAsync(AuthSessionConfig config)
        {
            var session = await AuthSession.InitAuthAsync(config);

            var client = new AuthClient(config, session);

            return(client);
        }
Example #3
0
        public async Task <AuthClient> CreateClientAsync()
        {
            string locator     = GetRandomString(10);
            string secret      = GetRandomString(10);
            string invitation  = GetRandomString(5);
            var    credentials = new Credentials(locator, secret);
            var    config      = new AuthSessionConfig(credentials, keepAlive: true, invitation);
            var    client      = await AuthClient.InitSessionAsync(config);

            return(client);
        }
Example #4
0
 AuthClient(AuthSessionConfig sessionConfig, AuthSession authenticator)
 {
     _sessionConfig = sessionConfig;
     _authenticator = authenticator;
     _authenticator.Disconnected += OnNetworkDisconnected;
 }