Reference:
* 2 legged oauth basic concepts (Chinese) http://djb4ke.iteye.com/blog/664958
* Google 2 legged oauth for Google Apps domain: http://code.google.com/intl/zh-TW/apis/accounts/docs/OAuth.html#GoogleAppsOAuth
* Example of
To use oauth to successfully call the Google API, you must first obtain the oauth access token.
In the process of obtaining oauth access token, we need to solve the following problems in sequence:
1. Prepare timestamp, nonce, and HMAC-SHA1 signatures for obtaining access token
A. Obtain timestamp:
Use qdatetime: curr
app
Authorization Server: Also known as API Provider (Google/facebook/twitter ... )
CLIENT_ID and Client_secret:server credentials issued to the APP
Access Token:server issued a token that accesses the resource API needs to take it
Scope:app provide the server with the kind of API that needs to be called
Redirect Url:app The callback address provided to the server
OAuth
redirect to the Google page for logon. The Code is as follows:
Public class oauthcontroller: controller {public actionresult googlelogin () {var url = "https://accounts.google.com/o/oauth2/auth? "+" Scope = {0} State = {1} redirect_uri = {2} response_type = Code client_id = {3} approval_prompt = force "; // userinfo. email indicates obtaining the user's ema
Introduction to oauth, you can refer to the http://oauth.net/documentation/getting-started/
For how to use oauth, I think this is the focus of our attention.
For the application of oauth, aside from the specific protocol, we need to know the answer to the following questions:
1. What is the final purpose of using
Read the previous article to understand the principles of Google oauth 2.0 at http://blog.csdn.net/totogogo/article/details/6860966.
Note that all the codes in the above article do not use the Google client library code. This article describes oauth 2.0 simple example using Google
dispute and view, although in the mind of PR has not much meaning, but others do not look so. If your site PR rose to 4, 5, I believe you in the exchange of links to the quality of the link to the site will be much easier. In exchange connection this piece oneself also has the personal feeling, 28 short message Network Although is a new station, but from Pr0 direct to PR4, therefore in the Exchange connection also reduced many time and the detour. Here's how I put a SMS site directly from
Google-glog open-source library Analysis (2): glog usage, google-glogglogGlog usage
Set symbol variables to customize log Behavior
For more information about how to set symbol variables, see symbol variables in glog introduction.
Log system initialization
Initialization function: google: InitGoogleLog
consumption. For example: gold coins, diamonds and so on.
Subscription: Sell content, services, or features to users within the app by monthly or yearly billing.
3. Get Server access Parameters
After payment is completed, it is necessary to verify the validity of the paid ticket on the server. Also, you need to get the server-side parameters. The steps are as follows:
(1) Use the developer account that created the app to access the
Free don't take a look at this blog: http://jonnyhsy.wordpress.com/category/algorithms-data-structure/
// Given an array a [n], build another array B [N], B [I] = A [0] * A [1] *… * A [n-1]/A [I]// No division can be used, O (n) time complexity
See the webpage:
Http://www.ihas1337code.com/2010/04/multiplication-of-numbers.html
Let's define array B where Element B [I] = multiplication of numbers from a [0] t
= 0; i
{
Ofile[i].close ();
}
DeleteCriticalSection (g_csfile);
return 0;
}
unsigned int __stdcall fun (void *ppm)
{
int num = (int) PPM;
int i = 0;
For (i = 0; i
{
//wait sequence trigger
WaitForSingleObject (G_hthreadevent[num],infinite);
EnterCriticalSection (g_csfile);
Section o offUsing Python to calculate 2 * * 38, replace the URL to1th PassReally covered, and finally Google a bit, only to understand that all the letter displacement >> two-bitImport= Str.maketrans ('abcdefghijklmnopqrstuvwxyz',' Cdefghijklmnopqrstuvwxyzab')print("'g fmnc wms Bgblr RPYLQJYRC GR ZW fylb. RFYRQ Ufyr AMKNSRCPQ ypc DMP. Bmgle GR GL ZW fylb GQ glcddgagclr ylb rfyr ' q UFW rfgq rcvr GQ QM Jml
Learn about the basics of Android from 0 (2)-Explanation of the AndroidMainfest. xml fileAndroidMainfest. xml file details
1. About AndroidManifest. xml
AndroidManifest. xml is a required file in every android program. It is located in the root directory of the entire project, describing components exposed in the package (activities, services, and so on), their respective implementation classes, various dat
Nginx is very suitable for web sites because it is small and occupies less resources. More and more Linux + nginx + PHP + MySQL sites have gradually surpassed Apache and Lighttpd in recent years.
If Google-perftools developed by Googler is used to optimize the memory management of nginx and MySQL, the performance will be improved to a certain extent. especially for servers with high concurrency, the effect is more obvious. this tutorial is applicable
Recently in the study of multi-threading, the topic originates from Mr. Morewindows's "second Kill multithreading First" (http://blog.csdn.net/morewindows/article/details/7392749)Title Excerpt:Question Fifth (Google interview questions)There are four threads of 1, 2, 3, 4. The function of thread 1 is output 1, the function of thread 2 is output
There are four threads (1, 2, 3, and 4) to write data synchronously ...... C ++ 11 Implementation, google
Recently I am studying multithreading, the title is derived from the first article of "second kill multithreading" (http://blog.csdn.net/morewindows/article/details/7392749) by Mr MoreWindows)Excerpt:
Question 5 (Google interview)
There are four threads: 1,
Weibo http://weibo.com/morewindowsis available. Welcome to the Forum.
This article series address: http://blog.csdn.net/MoreWindows/article/category/859207
In the last article "11 interesting Google interview questions in the vernacular classical algorithm series", I gave a detailed explanation of an interesting Google interview question. I used the base sorting method in O (n) the time complexity and the s
Google real-time search: 2-minute earthquake detection
How fast is Google real-time search? Today, a small earthquake occurred in the Gulf near San Jose, California (, Pacific time ), matt Cutts claims that Google users saw the news of the earthquake from Google's real-time search two minutes after the earthquake. Of
the name of the test instance, the two instances belong to the same factorialtest test case. You can set the name of the test instance at will, but the naming method that can reflect the test function is better.
Compile and execute the test codeProgramThe execution result is as follows:
Running main () from gtest_main.cc[=========] Running 2 Tests from 1 Test Case .[----------] Global test environment Set -Up.[----------]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.