saveAuthenticationResponse method

Future<void> saveAuthenticationResponse(
  1. String responseBodyAuthe
)

RequestTokenで受信したレスポンスボディの内容を、一時データベースに保存

Implementation

Future<void> saveAuthenticationResponse(String responseBodyAuthe) async {
  OAuthDataStorage storage = OAuthDataStorage();
  List<OAuthData> lstData = await storage.getOAuthData(OAuthData.USERID_TEMP);
  OAuthData data;
  if (0 < lstData.length) {
    data = lstData[0];
  } else {
    data = OAuthData(OAuthData.USERID_TEMP);
  }

  final dicParams = urlParametersToDict(responseBodyAuthe);

  data.authenticateToken = dicParams["oauth_token"];
  data.authenticateVerifier = dicParams["oauth_verifier"];
  data.authenticateDenied = dicParams["denied"];
  storage.updateOAuthData(data);
}