refreshRemoteToken static method

Future<Map<String, dynamic>?> refreshRemoteToken({
  1. required String clientId,
  2. required String clientSecret,
  3. required String refreshToken,
})

Refreshes the remote token that allows the user to connect to the bridge remotely.

May throw ExpiredRefreshTokenException if the refresh token is expired. If this happens, get the user to grand access to the app again by using BridgeDiscoveryRepo.remoteAuthRequest.

Implementation

static Future<Map<String, dynamic>?> refreshRemoteToken({
  required String clientId,
  required String clientSecret,
  required String refreshToken,
}) async {
  final Map<String, String> body = {
    "grant_type": "refresh_token",
    "refresh_token": refreshToken,
  };

  return _fetchRemoteToken(
    clientId: clientId,
    clientSecret: clientSecret,
    body: body,
  );
}