Authentication server in Go.
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
- JWT
- User account creation
- MongoDB persistance
- Login
- Access (AuthN and AuthZ) check
# 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