Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.16 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.16 KB

Go Auth Server

go report card license

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