First GitHub Project – MVC Web API using Google OAuth

I finally ended up activating my GitHub account that I signed up for years ago, and publish my first GitHub project. It is a MVC Web API project that uses Google OAuth for authentication. You can see it here.

Even though a lot of the MVC project templates supposedly come with external authentication fully configured, in practice I found that to be quite untrue (other than the single page app template). I could only get this to work after pulling information from several different blogs. I started off with an empty Web API project and only build pieces I needed as I went.

The other thing I was trying to do was send POST messages using Postman to google for authentication, and that did not work at all for me. I did get an authentication token back from Google, but I kept getting 401 when trying to make a POST call to the authorized function. Possible reasons could be, misconfiguration of Postman (even though I did verify everywhere else, and unauthorized GET was working fine), Google blocking it because it wants a consensual mouse click authorizing app access, or something else. I gave up on Postman and made AJAX calls on a simple HTML page.

mvc-web-api-google-oauth

So, if you are looking to add external authentication into your .NET MVC Web API, maybe this project on GitHub would be of some use to you!

First GitHub Project – MVC Web API using Google OAuth