Created
January 8, 2013 15:20
-
-
Save IskenHuang/4484588 to your computer and use it in GitHub Desktop.
Google oauth login from curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Step 1. get access token using curl | |
* https://developers.google.com/gdata/articles/using_cURL | |
* | |
* service name list | |
* https://developers.google.com/gdata/faq#clientlogin | |
* | |
*/ | |
curl https://www.google.com/accounts/ClientLogin \ | |
--data-urlencode Email=YOUR_GOOGLE_ACCOUNT \ | |
--data-urlencode Passwd=YOUR_PASSWORD \ | |
-d accountType=GOOGLE \ | |
-d service=YOUR_SERVICE_NAME | |
/* | |
* Example Response | |
* SID=DQAAAHYBADCv2pSv7nflacDNwz3zEDUGtrSvNVDcpkSfddi77b3U5sEaHmP8YLWhmA36F9rk85mL8J5dqo4apn0T1vKz0fPGI9Xtnuet6cuE2ZzYvrNIwbSC_HjTqF4zudNQnnlDuD2wqZT-g1qXI8KhGAQZV4NexHZoQPlabTsGuRZeIBxj1A | |
* LSID=EUBBBIaBADCl-kNxvRVmcQghpt3cqSMfEooKR9flLOUZqwgP9OrZS83gse-KSdTNeXhxsET7FYenDhceP9lIPOmesH-t9qh-AWUHjjMdZEbUNeF9mWyzln6Z-FajaiG-cVFkqW0ZJ8ZbnCP30xXj6xFK6QxaAcqy_9Pej8jhEnxS9E61ftQGPg | |
* Auth=EUBBIacAAADK-kNxvRVmcQghpt3cqSMfEooLNMflLNIQqwgP9OrZS83gs-KSdTNeXhxsET7FYePWmaD8Vsy1V4LSUGMUP48Je2TO8OcjBj6HgAtPhiZeX-gKDfagZDK44j4n-Tkb44nhOnp2_QPSnBj3Z2vYwOEDjjG3Q53aQVC2132JKOuGh | |
* | |
* Auth >> token | |
* | |
*/ | |
/* | |
* Step 2. Example Request | |
* | |
*/ | |
curl --silent --header "Authorization: GoogleLogin auth=YOUR_TOKEN" "YOUR_URL" |
any update on using Curl with oAuth 2.0?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fwiw, this no longer works -- now simply returns the URL https://developers.google.com/identity/protocols/AuthForInstalledApps which provides the following message: