Giter Site home page Giter Site logo

authentication-service's Introduction

Authentication Service

This Golang-based authentication service provides a secure and reliable solution for user authentication, utilizing PostgreSQL as the backend database. The service includes a well-documented API, powered by Swagger annotations, making it easy for developers to integrate authentication into their applications.

Features

  • User registration and login
  • Secure password hashing and storage
  • JWT token generation for authenticated users
  • Swagger-documented API for easy integration and development

Getting Started

Prerequisites

To run this authentication service, ensure you have the following prerequisites installed:

  • Go programming language
  • PostgreSQL database

Installation

  1. Clone the repository:
   git clone https://github.com/rf-krcn/authentication-service.git
   cd authentication-service
  1. Install dependencies:
   go install ./...
  1. Configuration

Configure the service by setting up the PostgreSQL connection details by editing the DSN in the main.go file.

  1. Run project
   go run ./cmd

Usage

Example API usage:

# Register a new user and obtain JWT token
curl -X POST http://localhost:8080/register -d '{"username": "exampleuser", "password": "securepassword"}'

# Login and obtain JWT token
curl -X POST http://localhost:8080/login -d '{"username": "exampleuser", "password": "securepassword"}'

# Reset password
curl -X POST http://localhost:8080/reset_password -d '{"user_name": "exampleuser", "password": "securepassword", "new_password": "newsecurepassword"}'

For more detailed information, refer to the API Documentation section.

API Documentation

The API is thoroughly documented using Swagger annotations. Access the Swagger UI at http://localhost:8080/docs/index.html to explore and interact with the API.

authentication-service's People

Contributors

rf-krcn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.