Implement your own authentication.
Firstly create Google OAuth2 keys
- Create new project
- Enable API & Services
- Welcome to the API Library
- Choose Gmail API and Enable
- Click "Create credentials"
- Then Choose Consent Screen
- Add authorized redirect URL, in our case it will be localhost:8080/callback
- Get client id and client secret
- Save it in a safe place
- /
- /login
- /callback
- go get golang.org/x/oauth2/google
- go get google.golang.org/api/gmail/v1
go run main.go
User information, messages, labels, drafts are easily accessible using Golang through Gmail API.