Giter VIP home page Giter VIP logo

go-single-sign-on-example's Introduction

Example Single Sign-On (SSO)

Alt text

demo

Alt text

Getting Started

Usage

Run the dockerized application by executing the following command:

docker-compose up

And visit https://localhost with your favourite web browser.

Prerequisites

Single Sign-On Providers

You will need to configure at least 1 single sign-on provider. The more the better.

Facebook

  1. Go to Facebook for Developers.
  2. Go to My Apps and create a new app by clicking on Create App (select "Build Connected Experiences").
  3. Scroll down and under Add Products to Your App, click Set Up in the Facebook Login card. In the left side navigation panel, go to Facebook Login > Settings, under Valid OAuth Redirect URIs enter https://localhost/api/v1/single-sign-on/facebook/callback.
  4. Go to Settings > Basic and copy App ID and App Secret.
  5. In docker-compose.yml, replace the values of FACEBOOK_CLIENT_ID and FACEBOOK_CLIENT_SECRET with the values of App ID and App Secret respectively.

GitHub

  1. On github.com, go to Settings > Developer Settings > OAuth Apps (or click here).
  2. Click on New OAuth App.
  3. Fill in https://localhost for Homepage URL and https://localhost/api/v1/single-sign-on/github/callback for Authorization callback URL, and click on Register Application.
  4. From General, copy Client ID and generate a new Client Secret.
  5. In docker-compose.yml, replace the values of GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET with the values of Client ID and Client Secret respectively.

Google

  1. Go to Google Console Developer APIs & Services
  2. From the projects list, create a new project.
  3. Go to OAuth consent screen in the left side navigation panel.
  4. Configure the OAuth consent screen. Fill in all required fields and click save and continue.
  5. Go to Credentials in the left side navigation panel.
  6. Click create credentials in the top navigation panel and select OAuth Client ID. For Application Type select Web application. Under Authorized redirect URIs add the callback uri https://localhost/api/v1/single-sign-on/google/callback. Finally, click create.
  7. Copy Client ID and Client Secret.
  8. In docker-compose.yml, replace the values of GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET with the values of Client ID and Client Secret respectively.

If you're experiencing difficulties setting up the OAuth Client, see https://support.google.com/cloud/answer/6158849.

Single Sign-On Flow

Alt text

go-single-sign-on-example's People

Contributors

barj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.