Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with Google authentication



A popular login option to give users is to allow them to authenticate with your application using their Google account. ServiceStack provides a built-in OAuth provider to make this as easy as possible. In this recipe, we will go through how to get started with Google authentication and ServiceStack.

Getting ready

First, we are going to need an application to integrate, we will start with a template from the ServiceStackVS Visual Studio extension. If you are using Visual Studio Express, please see the Creating your ServiceStack solution with Visual Studio and NuGet section in Appendix A, Getting Started, and continue from the second instruction in the How to do it… section.

At the time of writing, Google provides an OAuth2 endpoint to authenticate. Thankfully, ServiceStack comes with support for Google's OAuth2 provider; however, a separate library does have to be added to support it. The NuGet package, ServiceStack.Authentication.OAuth2, will need...