Skip to content

A secure authentication system built with Golang, Gorilla Sessions, JWT, and PostgreSQL.

Notifications You must be signed in to change notification settings

jeferagudeloc/gorilla-sessions-auth

Repository files navigation

Gorilla Session Authentication/Authorization (GSAA)

GSAA is a secure authentication system built with Go, Gorilla Sessions, JWT, PostgreSQL, and Clean Architecture.

Table of Contents

Description

GSAA provides a robust and secure authentication system with the following key features:

  • User registration and account creation
  • User login and session management
  • User logout and session invalidation
  • Token-based authentication using JWT (JSON Web Tokens)
  • PostgreSQL database for data storage
  • Clean Architecture design principles for modular and maintainable code

Diagram

Try from UI

You can use the following repo for testing this project.

https://github.com/jeferagudeloc/nuxt-vue-tailwind-login.git

Usage

Follow the steps below to run the GSAA application:

  1. Clone the repository:
git clone https://github.com/jeferagudeloc/gorilla-sessions-auth.git
  1. Navigate to the project directory:
cd gorilla-sessions-auth
  1. Build and run the application using Docker Compose:
docker-compose up --build

This command will start the application along with the PostgreSQL database and Nginx proxy server.

  1. Access the application through your web browser:
http://localhost:18080

This will open the GSAA web interface where you can register, log in, and manage user accounts.

Routes

The following routes are available in the GSAA application:

  • /health: Performs a health check to ensure the server is running.
  • /authentication: Handles user authentication by validating credentials and generating a session token.
  • /logout: Logs out the user by invalidating the session token and removing session data.
  • /users: Handles user creation by creating a new user account.

PostgreSQL Tables

The GSAA application uses the following tables in the PostgreSQL database:

  • users: Stores user account information, including name, email, password, and status.
  • companies: Stores company information, linked to user accounts through a foreign key relationship.
  • profiles: Stores user profile information, linked to user accounts through a foreign key relationship.
  • permissions: Stores permission information for user profiles, linked to profiles through a foreign key relationship.

Postman Collection

gorilla-sessions-auth.postman_collection.json

About

A secure authentication system built with Golang, Gorilla Sessions, JWT, and PostgreSQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published