public TywiAccount GetTywiAccount() { TywiAccount account = new TywiAccount() { ClientId = this.ClientID, ClientSecret = this.ClientSecret, Name = this.Account }; return account; }
/// <summary> /// Create a new TYWI Session using the given account /// </summary> public static TywiSession Create(TywiAccount account) { return ConnectTo(null, account); }
/// <summary> /// Connect to an existing TYWI Session using the given account and ID /// </summary> public static TywiSession ConnectTo(string id, TywiAccount account) { AuthApiService authService = new AuthApiService(account); string bearerToken = authService.Authorise(); return new TywiSession(account.Name, bearerToken, id); }
/// <summary> /// Constructor /// </summary> /// <param name="account">The TYWI account to use for authorisation</param> public AuthApiService(TywiAccount account) { _account = account; }