Skip to content

This is a simple authentication API for all SecNex services. It is built using Go and PostgreSQL.

Notifications You must be signed in to change notification settings

SecNex/authentication-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecNex Authentication API

This is a simple authentication API for all SecNex services. It is built using Go and PostgreSQL.

Development

  1. Create a .env file based on .env.example and populate with your values.
  2. Run go run . to start the server.

Usage

Login

To login, send a POST request to /auth/login with a JSON body containing the username and password.

curl -X POST http://localhost:8081/auth/login -H "Content-Type: application/json" -d '{"username": "testuser", "password": "password123"}'

Refresh Token

To refresh the access token, send a POST request to /auth/refresh with a JSON body containing the refresh token.

curl -X POST http://localhost:8081/auth/refresh -H "Content-Type: application/json" -d '{"refresh_token": "your_refresh_token"}'

Logout

To logout, send a POST request to /auth/logout with a JSON body containing the refresh token.

curl -X POST http://localhost:8081/auth/logout -H "Content-Type: application/json" -d '{"refresh_token": "your_refresh_token"}'

About

This is a simple authentication API for all SecNex services. It is built using Go and PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published