edgex-auth
edgex-auth copied to clipboard
Starter kit for Golang user auth (account creation + login) servers with JWT
Go Auth Server
Authentication server in Go.
Install
Installing EdgeX Auth Server is trivial go get:
go get github.com/drasko/edgex-auth
cd edgex-auth/cmd
go buld -o edgex-auth
./edgex-auth
Features
- JWT
- User account creation
- MongoDB persistance
- Login
- Access (AuthN and AuthZ) check
Usage
# Create user
curl -isS -X POST -k --cacert proxy/nginx/ssl/certs/mainflux-server.crt https://localhost/users -d '{"username":"drasko", "password":"123"}'
# Get the token
curl -isS -X POST -k --cacert proxy/nginx/ssl/certs/mainflux-server.crt https://localhost/login -d '{"username":"drasko", "password":"123"}'
# Use the token in `Authorization` header
curl -k --cacert proxy/nginx/ssl/certs/mainflux-server.crt -H "Authorization: <user_token>" https://localhost/api/hello
License
Apache License, version 2.0