Bui api login - Bui api login in golang

bui-api-login

Project setup

go mod tidy -compat=1.17

.env.local

OAUTH2_REDIRECT_URL=http://localhost:8080

OAUTH2_GOOGLE_CLIENT_ID=XXXXXX.apps.googleusercontent.com
OAUTH2_GOOGLE_CLIENT_SECRET=XXXXX
OAUTH2_GOOGLE_AUTH_URL=https://accounts.google.com/o/oauth2/auth
OAUTH2_GOOGLE_TOKEN_URL=https://accounts.google.com/o/oauth2/token
OAUTH2_GOOGLE_PROFILE_URL=https://www.googleapis.com/oauth2/v1/userinfo
OAUTH2_GOOGLE_SCOPES=email

OAUTH2_FACEBOOK_CLIENT_ID=XXXXX
OAUTH2_FACEBOOK_CLIENT_SECRET=XXXXX
OAUTH2_FACEBOOK_AUTH_URL=https://www.facebook.com/v12.0/dialog/oauth
OAUTH2_FACEBOOK_TOKEN_URL=https://graph.facebook.com/v12.0/oauth/access_token
OAUTH2_FACEBOOK_PROFILE_URL=https://graph.facebook.com/v12.0/me?fields=id,name,email,picture
OAUTH2_FACEBOOK_SCOPES=email,public_profile

Compiles and hot-reloads for development

export $(xargs <.env.local)
go run main.go

TESTS

export T=`curl -s -X POST -d '{"email":"[email protected]","password":"asd"}' localhost:8000/userLogin | jq -r '.token'`

curl -v  -H "Authorization: Bearer $T" http://localhost:8000/tokenVerify

Similar Resources

Sample gin api with Golang

Installation Run the following command to install packages and dependencies go mod tidy Create .env file in root directory: DB_HOST=localhost DB_USER=

Nov 29, 2021

Auth: a simple signup api for golang

auth This is a simple signup api You can access the db.go file and change the database credentials to your local postgres credentials. To run it prope

Oct 4, 2022

🔥 Golang Rest Api with basic JWT Authentication and Basic Crud Operations.

🔥 Golang Rest Api with basic JWT Authentication and Basic Crud Operations.

Oct 4, 2022

Authenticated encrypted API tokens (IETF XChaCha20-Poly1305 AEAD) for Golang

branca.go is branca token specification implementation for Golang 1.15+.

Dec 26, 2022

Golang Skeleton With Fully Managed Versions For Kick Start GoLang Project Development

Golang Skeleton With Fully Managed Versions For Kick Start GoLang Project Development

Golang Skeleton With Fully Managed Versions For Kick Start GoLang Project Development There is no doubt that Golang’s good documentation and intellige

Dec 31, 2022

Oauth2-golang - Oauth2 Golang Mysql

Oauth2-golang - Oauth2 Golang Mysql

Sep 16, 2022

:key: Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

branca branca is a secure alternative to JWT, This implementation is written in pure Go (no cgo dependencies) and implements the branca token specific

Dec 29, 2022

Key-Checker - Go scripts for checking API key / access token validity

Key-Checker - Go scripts for checking API key / access token validity

Key-Checker Go scripts for checking API key / access token validity Update V1.0.0 🚀 Added 37 checkers! Screenshoot 📷 How to Install go get github.co

Dec 19, 2022

fiber api key authentication middleware

fiber-key-auth Secure your fiber endpoints using API keys. Report Bug · Request Feature Table of Contents About The Project Built With Getting Started

Dec 14, 2022
JWT login microservice with plugable backends such as OAuth2, Google, Github, htpasswd, osiam, ..
JWT login microservice with plugable backends such as OAuth2, Google, Github, htpasswd, osiam, ..

loginsrv loginsrv is a standalone minimalistic login server providing a JWT login for multiple login backends. ** Attention: Update to v1.3.0 for Goog

Dec 24, 2022
:closed_lock_with_key: Middleware for keeping track of users, login states and permissions

Permissions2 Middleware for keeping track of users, login states and permissions. Online API Documentation godoc.org Features and limitations Uses sec

Dec 31, 2022
simple-jwt-provider - Simple and lightweight provider which exhibits JWTs, supports login, password-reset (via mail) and user management.

Simple and lightweight JWT-Provider written in go (golang). It exhibits JWT for the in postgres persisted user, which can be managed via api. Also, a password-reset flow via mail verification is available. User specific custom-claims also available for jwt-generation and mail rendering.

Dec 18, 2022
an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
an SSO and OAuth / OIDC login solution for Nginx using the auth_request module

Vouch Proxy An SSO solution for Nginx using the auth_request module. Vouch Proxy can protect all of your websites at once. Vouch Proxy supports many O

Jan 4, 2023
Cache oci login token for kubectl

oci-token-cache Cache oci login token. This command cache oci login token into ~/.oci/token-cache.json and re-use for kubectl. Usage Currently, your ~

Nov 20, 2021
Lightweight SSO Login System

login Lightweight SSO Login System Convention Redirect to login.changkun.de?redirect=origin When login success, login.changkun.de will redirect to ori

Sep 29, 2022
Goauth: Pre-made OAuth/OpenIDConnect and general authorization hooks for webapp login

goauth Pre-made OAuth/OpenIDConnect and general authorization hooks for webapp login. Currently supports Google, Facebook and Microsoft "out of the bo

Jan 28, 2022
JWT login microservice with plugable backends such as OAuth2, Google, Github, htpasswd

login-service login-service is a standalone minimalistic login server providing a (JWT)[https://jwt.io/] login for multiple login backends. Abstract l

Feb 12, 2022
Ginx - Evilginx2 - A man-in-the-middle attack framework used for phishing login credentials along with session cookies
Ginx - Evilginx2 - A man-in-the-middle attack framework used for phishing login credentials along with session cookies

evilginx2 is a man-in-the-middle attack framework used for phishing login creden

Mar 19, 2022
Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.

❗ Cache package has been moved to libcache repository Go-Guardian Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to

Dec 23, 2022