An open API service indexing awesome lists of open source software.

https://github.com/nikhilnarayanan623/go-gin-google-oauth2

Authenticate with user gmail using Google OAuth2
https://github.com/nikhilnarayanan623/go-gin-google-oauth2

clean-code go goauth2 golang

Last synced: 12 months ago
JSON representation

Authenticate with user gmail using Google OAuth2

Awesome Lists containing this project

README

          

# `Google Authentication` Implimentaion Using `Go programing` with `gin` framework and `goth google` package

# Used Packages
1. [GIN](github.com/gin-gonic/gin) is a web framework written in Go (Golang). It features a martini-like API with performance that is up to 40 times faster thanks to httprouter. If you need performance and good productivity, you will love Gin.
2.[GOTH]("github.com/markbates/goth") Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

# To Use This `go-gin-google-oauth2` Implimentaion

# Follow these steps

1. clone my github `go-gin-google-oauth2` repository to your system
2. after cloning use follwing bash commands

``` bash commands
## these bash comands are set-up on makefilie ##
## if you did't install make then install make or use `go run ./cmd/api/`

# Step 1 : Navigate into project directory
cd ./go-gin-google-oauth2

# Step 2 : Install needed dependencies
make deps
#or
go mod tidy

# Step 3 : Setup Env files
1.vist `https://console.cloud.google.com/apis/dashboard` for creating google client_id and client_secret
#setup env
2.GOAUTH_CLIENT_ID="Your Client Secret ID"
3.GOAUTH_CLENT_SECRET="Your Client Secret"

# Step 4 : Run the Server
make run

# check server.go for see the api's
# open a browser and visit `localhost:8000/login`

```