getAuth method

Future<Client> getAuth()

try to get sts auth token

Implementation

Future<Client> getAuth() async {
  if (this._auth != null) {
    return this;
  }
  if (this.checkExpire(this._expire)) {
    return this;
  } else {
    final resp = await this.tokenGetter(this.stsRequestUrl);
    final respMap = jsonDecode(resp) as Map<String, dynamic>;
    this._auth = Auth(respMap['AccessKeyId']!, respMap['AccessKeySecret']!,
        respMap['SecurityToken']);
    this._expire = respMap['Expiration'];
    return this;
  }
}