Authentication with Google to access the Data of User like Google Calendar
Posted By : Abhay Garg | 23-Dec-2014
Basically there are two approaches to acceess data from Google . Both have their own benefits
1st approach -> Public API access
Login with your Gmail id . Go to that link Google console . Create a project , and open that project .
On left side there is link APIs and auths .
Click on Credentials , there is option Public API access create your own key .
Let suppose you want to get the Distance betwwen two addresses , So for that purpose you can use Google Api .
So in this purpose you can use Public Key because that data is Publically Available , So whenever you use google API that is publically available then go towards Public API key.
2nd Approach -> OAuth
OAuth means authentication is required to access Google Data . Let suppose you want to Social Authentication (login using Gmail ) , So for this purpose Authentication is required , there are a lot of APIs that google Provide like to access the data of Google Calendar of user etc
Login with your Gmail id . Go to that link Google console . Create a project , and open that project .
On left side there is link APIs and auths . Click on Credentials , there is option Create client ID create your own key .
So whatever you API need from Google enable that API from google Console.
NOTE -> If you are in testing environment and test on localhost then provide
EX JAVASCRIPT ORIGINS-> http://localhost:8080 (If hit go from gapi client site(javascript))
REDIRECT URIS -> http://localhost:8080/oauth/callback/googleplus
**** Be specific in URIS and JAVASCRIPT ORIGINS otherwise it give error origin-mismatch .
And be specific of using http or https . And if you have your own Domain name then provide that.
Thanks
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Abhay Garg
Abhay is a Grails Developer expertise in OptaPlanner and Angular js framework.