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
- Host: GitHub
- URL: https://github.com/nikhilnarayanan623/go-gin-google-oauth2
- Owner: nikhilnarayanan623
- Created: 2023-04-18T10:21:38.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T10:40:16.000Z (about 3 years ago)
- Last Synced: 2025-03-27T14:52:36.603Z (about 1 year ago)
- Topics: clean-code, go, goauth2, golang
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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`
```