Quantcast
Channel: web – Imran Tariq's Blog
Viewing all articles
Browse latest Browse all 33

Google OAuth: Get User Data

$
0
0

Create a new Project from Google API Console and get Client Id and Secret Key.  https://code.google.com/apis/console

Following this example https://code.google.com/p/google-api-java-client/wiki/OAuth2Draft10 as a help to Develop OAUTH Client Plugin for Google.

Make sure that you have changed your scope, call back URL and shortend URL etc according to your needs.

private static final String SCOPE = "https://www.googleapis.com/auth/urlshortener";
private static final String CALLBACK_URL = "urn:ietf:wg:oauth:2.0:oob";
...

GenericUrl shortenEndpoint = new GenericUrl("https://www.googleapis.com/urlshortener/v1/url");

This page will help you to understand authentication and authorization flow https://developers.google.com/accounts/docs/OAuth2

Cheers

Share


Viewing all articles
Browse latest Browse all 33

Trending Articles