Alexandre-

You also need to set the callback parameter. You can find that information 
about the parameters that you need here: 
http://code.google.com/apis/accounts/docs/OAuth_ref.html

The following may help you... The following illustrates the process for 
setting up OAuth 1.0 using the google-api-java-client for a client 
application (non-web application):

// Step 1: Get OAuth Request Token
GoogleOAuthGetTemporaryToken temporaryToken =
    new GoogleOAuthGetTemporaryToken();
temporaryToken.callback = "oob";
signer.clientSharedSecret = <CLIENT_SHARED_SECRET_HERE>;
temporaryToken.signer = signer;
temporaryToken.consumerKey = <CONSUMER_KEY_HERE>;
temporaryToken.scope = "https://apps-apis.google.com/a/feeds";;
temporaryToken.transport = new NetHttpTransport();
OAuthCredentialsResponse tempCreds = temporaryToken.execute();

// Step 2: Get OAuth Authorize Token
signer.tokenSharedSecret = tempCreds.tokenSecret;
GoogleOAuthAuthorizeTemporaryTokenUrl authorizeUrl = new 
GoogleOAuthAuthorizeTemporaryTokenUrl();
authorizeUrl.temporaryToken = tempCreds.token;
String authorizationUrl = authorizeUrl.build();
System.out.println("Go to this authorizationUrl: " + authorizationUrl);
BufferedReader inStream = new BufferedReader(new 
InputStreamReader(System.in));
System.out.print("Paste verification code: ");
String verifier = inStream.readLine();

// Step 3: Get OAuth Access Token
GoogleOAuthGetAccessToken accessToken = new GoogleOAuthGetAccessToken();
accessToken.temporaryToken = tempCreds.token;
accessToken.signer = signer;
accessToken.consumerKey = <CONSUMER_KEY_HERE>;
accessToken.verifier = verifier;
accessToken.transport = new NetHttpTransport();
OAuthCredentialsResponse creds = accessToken.execute();
signer.tokenSharedSecret = creds.tokenSecret;

-Aaron

-- 
You received this message because you are subscribed to the Google Groups 
"Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-apps-mgmt-apis/-/MYOhaFKjAdUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to