Oauth2 Golang Mysql

  • Mysql to store token

install

git clone https://github.com/danangkonang/oauth2-golang.git

cd oauth2-golang

go mod tidy

#database(optional)
docker-compose up -d

./gomigrator up migration

go run main.go

response

{
  "access_token": "sDrk..",
  "token_type": "Bearer",
  "refresh_token": "jkudy8..",
  "expiry": 7195,
}

GitHub

View Github