Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

OAuth 2.0 + Auth0 SSO

Single Sign-On на Go с аутентификацией через Auth0 и Google.


Tech Stack

Go Gin Auth0 OAuth2 OIDC TailwindCSS


Quick Start

git clone https://github.com/qqwozz/OAuth_2.0.git
cd OAuth_2.0
cp .env.example .env
# Заполните .env своими данными Auth0
go run main.go

Откройте http://localhost:8080 → нажмите Sign In with Google


2. Настройте Auth0

  1. Зарегистрируйтесь на auth0.com
  2. Создайте Regular Web Application
  3. Скопируйте из настроек приложения:
Параметр Где найти
AUTH0_DOMAIN Applications → Your App → Domain
AUTH0_CLIENT_ID Applications → Your App → Client ID
AUTH0_CLIENT_SECRET Applications → Your App → Client Secret
  1. Добавьте в Allowed Callback URLs:

    http://localhost:8080/callback
    
  2. Добавьте в Allowed Logout URLs:

    http://localhost:8080/
    

Configuration

Variable Required Description
AUTH0_DOMAIN Yes Auth0 domain
AUTH0_CLIENT_ID Yes Auth0 client ID
AUTH0_CLIENT_SECRET Yes Auth0 client secret
AUTH0_REDIRECT_URL Yes http://localhost:8080/callback
PORT No 8080

Routes

Method Path Auth Description
GET / - Home
GET /login - Redirect to Auth0
GET /callback - OAuth callback
GET /profile Yes User profile
GET /avatar Yes Avatar proxy
GET /logout - Logout

License

MIT © Dima Kiselev

About

Single Sign-On на Go с аутентификацией через Auth0 и Google.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages