I am trying to login to google using the libcurl library in C. But google answers me: "The functionality of your browser browser is disabled. Please enable it."
Here is the code:
#include <stdio.h> #include <stdlib.h> #include <curl/curl.h> size_t get_buffer(void *buffer, size_t size, size_t nmemb, void *userp); int main(void) { CURL *curl; CURLcode res; char *data="service=...&dsh=...&GALX=...&pstMsg=0&dnCon=&checkConnection=&Email=...&Passwd=..."; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://accounts.google.com/ServiceLoginAuth"); curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookie"); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookie"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, get_buffer); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } return 0; }
Any idea? Thanks.
kyori source share