Book Image

Go Programming Blueprints

By : Mat Ryer
Book Image

Go Programming Blueprints

By: Mat Ryer

Overview of this book

Table of Contents (17 chapters)
Go Programming Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

OAuth2


OAuth2 is an open authentication and authorization standard designed to allow resource owners to give clients delegated access to private data (such as wall posts or tweets) via an access token exchange handshake. Even if you do not wish to access the private data, OAuth2 is a great option that allows people to sign in using their existing credentials, without exposing those credentials to a third-party site. In this case, we are the third party and we want to allow our users to sign in using services that support OAuth2.

From a user's point of view, the OAuth2 flow is:

  1. A user selects provider with whom they wish to sign in to the client app.

  2. The user is redirected to the provider's website (with a URL that includes the client app ID) where they are asked to give permission to the client app.

  3. The user signs in from the OAuth2 service provider and accepts the permissions requested by the third-party application.

  4. The user is redirected back to the client app with a request code.

  5. In the background...