loginWithClientCredentials method

Future<Session> loginWithClientCredentials()

///////////////////////////////////////////Authentication/////////////////////////////////////////////////////////

Implementation

Future<Session> loginWithClientCredentials() async {
  Device device = await Device.mkDevice();
  var body = <String, dynamic>{
    "grant_type": "client_credentials",
    "client_id": this.config.clientId,
    "client_secret": this.config.clientSecret,
    "device": device.toJson()
  };
  return apiPost("/access/token", body)
      .then((res) => processAccessToken(res))
      .then((session) =>  session );
}