callback method

Future<Credential> callback (
  1. Map<String, String> response
)

Implementation

Future<Credential> callback(Map<String, String> response) async {
  if (response["state"] != state) {
    throw new ArgumentError("State does not match");
  }
  if (response.containsKey("code") &&
      (type == FlowType.proofKeyForCodeExchange ||
          client.clientSecret != null)) {
    var code = response["code"];
    return new Credential._(client, await _getToken(code), null);
  } else if (response.containsKey("access_token") ||
      response.containsKey("id_token")) {
    return new Credential._(
        client, new TokenResponse.fromJson(response), _nonce);
  } else {
    return new Credential._(
        client, new TokenResponse.fromJson(response), _nonce);
  }
}