Пример #1
0
 public TywiAccount GetTywiAccount()
 {
     TywiAccount account = new TywiAccount()
     {
         ClientId = this.ClientID,
         ClientSecret = this.ClientSecret,
         Name = this.Account
     };
     return account;
 }
Пример #2
0
 /// <summary>
 /// Create a new TYWI Session using the given account
 /// </summary>
 public static TywiSession Create(TywiAccount account)
 {
     return ConnectTo(null, account);
 }
Пример #3
0
        /// <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);
        }
Пример #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="account">The TYWI account to use for authorisation</param>
 public AuthApiService(TywiAccount account)
 {
     _account = account;
 }