Skip to content

Starter kit for Golang user auth (account creation + login) servers with JWT

License

Notifications You must be signed in to change notification settings

drasko/edgex-auth

Repository files navigation

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

About

Starter kit for Golang user auth (account creation + login) servers with JWT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages