Adding Google Sign-in And Others
Introduction
The purpose of this post is to show how to add any Oauth login to your site, but mostly Google Plus because of my current applications (Penguins Rising!). In my quest to achieve this I found it to be really simple with Google Plus and the only real trouble I had was with the Client Id. I setup my Google API service account years ago but never really tried anything until now. What I did was just recreate a client id and everything worked!
My Website Oauth Choices
This next part is a little of my opinion and about what I think is the best strategy for Oauth integration. For me when it comes to social medias and integrating user logins I like to go the route of making sure I have all three of the major. The major hitter in my book are Twitter, Google Plus, and of course Facebook. However I know a lot of sites differ on the importance these three . Still personally I like seeing Google Plus being available and I think any site that has the other two but not Google Plus is really just lazy. That or doesn't see the benefit of adding it. Right now if I would have to look at all three of these social sites and why I would add all of them, I describe it like so. ..
- A community of close friends/family members. Sometimes acquaintances...
- Google Plus
- The opposite of Facebook, A community of anyone with similar interests.
- The combination of the two but without any real profiling to the users. A way speak to a larger audience without the drama. So its really helpful if you have game coming out (hint.. October 1st.)
All three have a different community to add, Twitter being the backbone really of both communities in my opinion. Still I've been looking at other sites that have add all three and found that a lot of them have custom icons to unify them together which I think sends a message. This is a message I also believe in which is when it comes to an application it really doesn't matter which ones clients use just along as they get enjoy the application sooner. So including all three makes it easier for people to enjoy the application because they can more easily access or connect to the app.
CNN Options |
//Example like so...
<button class="g-signin"
data-scope="https://www.googleapis.com/auth/games"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-clientId="YourClientIDhere"
data-callback="onSignInCallback"
data-theme="dark"
data-cookiepolicy="single_host_origin">
</button>
c# - Great for an MVC application, however there is an easier way find that I found.
The other way I found allows you to add all three in an MVC app with little or not work.
The other way I found allows you to add all three in an MVC app with little or not work.
The Article: Using OAuth Providers with MVC4 is really easy and requires very little extra
work if you just start a new application. I also found this tutorial that goes in depth for twitter and facebook but did not get a change yet to go through it.