void IDisposable.Dispose() { _authenticator.Disconnected -= OnNetworkDisconnected; FreeState(); _sessionConfig = null; GC.SuppressFinalize(this); }
public static async Task <AuthClient> InitSessionAsync(AuthSessionConfig config) { var session = await AuthSession.InitAuthAsync(config); var client = new AuthClient(config, session); return(client); }
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); }
AuthClient(AuthSessionConfig sessionConfig, AuthSession authenticator) { _sessionConfig = sessionConfig; _authenticator = authenticator; _authenticator.Disconnected += OnNetworkDisconnected; }