{"id":23173311,"url":"https://github.com/ramonbecker/ms-auth","last_synced_at":"2026-04-04T22:34:11.553Z","repository":{"id":264706684,"uuid":"893385925","full_name":"RamonBecker/ms-auth","owner":"RamonBecker","description":"Development of two authentication projects in microservices, using two models: stateful and stateless. Auth represents an authentication API. Any represents any API, which will only have to validate the access token","archived":false,"fork":false,"pushed_at":"2024-12-12T20:52:12.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T08:47:58.397Z","etag":null,"topics":["authentication","authorization","docker","docker-compose","java","jwt-authentication","jwt-authorization","jwt-decode","jwt-token","microservice","postgres","postgresql","python","stateful","stateless","token"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RamonBecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T10:02:40.000Z","updated_at":"2025-01-09T17:27:00.000Z","dependencies_parsed_at":"2024-12-12T21:26:17.926Z","dependency_job_id":"03680f22-00a4-42d5-a384-29e04a77666a","html_url":"https://github.com/RamonBecker/ms-auth","commit_stats":null,"previous_names":["ramonbecker/ms-auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamonBecker%2Fms-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamonBecker%2Fms-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamonBecker%2Fms-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamonBecker%2Fms-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RamonBecker","download_url":"https://codeload.github.com/RamonBecker/ms-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247268039,"owners_count":20911068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authorization","docker","docker-compose","java","jwt-authentication","jwt-authorization","jwt-decode","jwt-token","microservice","postgres","postgresql","python","stateful","stateless","token"],"created_at":"2024-12-18T05:11:43.640Z","updated_at":"2025-12-30T23:07:45.846Z","avatar_url":"https://github.com/RamonBecker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ms-auth\n\n## :information_source: Information \n\nDevelopment of two authentication projects in microservices, using two models: stateful and stateless. Auth represents an authentication API. Any represents any API, which will only have to validate the access token. The operating model of the applications will be shown below.\n\n## Stateless vs Stateful\n\nThis table highlights the key differences between stateless and stateful systems:\n\n| **Stateless**        | **Stateful**        |\n|-----------------------|---------------------|\n| No session           | Session-based       |\n| No login             | Login functionality |\n| No basket            | Basket functionality|\n| Static content       | Dynamic content     |\n\n---\n\nStateless systems are typically simpler and scale better, but stateful systems are more suitable for interactive and personalized applications.\n\n\n## Stateless Model\n\n![Stateless Authentication  JWT Token](https://github.com/user-attachments/assets/7e88b08d-57ab-49fc-9302-70eb6113542e)\n\n\n## Stateful Model\n\n![Stateful Authentication  Opaque Token](https://github.com/user-attachments/assets/e3a329a0-5ba5-4804-ac0e-f005d62c43cd)\n\n\n\n## :rocket: Installation\n\n![](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)\n\n\n```\ngit clone https://github.com/RamonBecker/ms-auth.git\n```\n\n![](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n```\ngit clone https://github.com/RamonBecker/ms-auth.git\nor install github https://desktop.github.com/ \n```\n\n## 🔨 Docker\n\nBefore cloning the project, you will need to install docker on your operating system.\n\nFor windows, enter the following from the link:\n\n```\nhttps://docs.docker.com/desktop/windows/install/\n```\n\nFor linux, follow the procedure below:\n- Update your existing list of packages:\n\n```\nsudo apt update\n```\n\n- Install some prerequisite packages that let apt use packages over HTTPS:\n\n```\nsudo apt install apt-transport-https ca-certificates curl software-properties-common\n\n```\n\n- Add the GPG key to the official Docker repository on your system:\n\n```\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n```\n- Add the Docker repository to the APT sources:\n\n```\nsudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable\"\n\n```\n\n- Update the package database with Docker packages from the newly added repository:\n\n```\nsudo apt update\n```\n\n- Make sure you are about to install from the Docker repository instead of the default Ubuntu repository:\n\n```\napt-cache policy docker-ce\n```\n\n- Install Docker:\n\n```\nsudo apt install docker-ce\n```\n\n- Check if it is working:\n\n```\nsudo systemctl status docker\n```\n\n\nAfter cloning the project, perform the following\nEnter the services folder, then enter the v2 folder and run the following command:\n\n```\ndocker-compose up   \n```\n\n# 🔨 Python Installation\n## Installation on Windows\n\n1. **Download the Python Installer**\n   - Visit the official Python website: [https://www.python.org/downloads/](https://www.python.org/downloads/).\n   - Click the button to download the latest version of Python 3 for Windows.\n\n2. **Run the Installer**\n   - Locate the downloaded file and double-click to open it.\n   - **Important**: Check the **\"Add Python 3.x to PATH\"** option before clicking \"Install Now.\"\n\n3. **Choose the Installation Type**\n   - **Recommended**: Click \"Install Now\" for a default installation.\n   - To customize, click \"Customize Installation.\"\n\n4. **Complete the Installation**\n   - Once the installation finishes, click \"Close.\"\n\n5. **Verify the Installation**\n   - Open the **Command Prompt** and type:\n     ```bash\n     python --version\n     ```\n     or\n     ```bash\n     python3 --version\n     ```\n   - This will display the installed Python version.\n\n---\n\n## Installation on Linux\n\n1. **Update Repositories**\n   - Open the terminal and run:\n     ```bash\n     sudo apt update \u0026\u0026 sudo apt upgrade -y\n     ```\n\n2. **Install Python 3**\n   - For Debian/Ubuntu-based distributions:\n     ```bash\n     sudo apt install python3\n     ```\n   - For Fedora/CentOS-based distributions:\n     ```bash\n     sudo dnf install python3\n     ```\n\n3. **Install Pip**\n   - On Debian/Ubuntu:\n     ```bash\n     sudo apt install python3-pip\n     ```\n   - On Fedora/CentOS:\n     ```bash\n     sudo dnf install python3-pip\n     ```\n\n4. **Verify the Installation**\n   - In the terminal, type:\n     ```bash\n     python3 --version\n     ```\n   - This will display the installed Python version.\n\n---\n\n## Extra Tips\n\n- **Virtual Environments**:\n  To manage dependencies in isolation, create a virtual environment:\n  ```bash\n  python3 -m venv env_name\n  source env_name/bin/activate  # Linux/Mac\n  env_name\\Scripts\\activate     # Windows\n\n## **APIs**\n\nBelow are the host and port details for the APIs:\n\n| **Application**         | **URL**                                              |\n|--------------------------|------------------------------------------------------|\n| `stateless-auth-api`     | [http://localhost:8080/swagger-ui/index.html](http://localhost:8080/swagger-ui/index.html) |\n| `stateless-any-api`      | [http://localhost:8081/swagger-ui/index.html](http://localhost:8081/swagger-ui/index.html) |\n| `stateful-auth-api`      | [http://localhost:8082/swagger-ui/index.html](http://localhost:8082/swagger-ui/index.html) |\n| `stateful-any-api`       | [http://localhost:8083/swagger-ui/index.html](http://localhost:8083/swagger-ui/index.html) |\n\n---\n\n## **Databases**\n\nBelow are the host and port details for the databases:\n\n| **Database**             | **Type**     | **Host**           | **Port** |\n|--------------------------|--------------|--------------------|----------|\n| `stateless-auth-db`      | PostgreSQL   | `localhost`        | `5432`   |\n| `stateful-auth-db`       | PostgreSQL   | `localhost`        | `5433`   |\n| `token-redis`            | Redis        | `localhost`        | `6379`   |\n\n\n## **Running Everything with the Utility Script**\n\nTo run all applications and databases using the utility script, execute the following command:\n\n```bash\npython3 build.py\n```\n\n## **Docker Tips**\n\nHere are some useful Docker commands to manage containers and logs:\n\n### **Remove Existing Containers**\n- **Stop all containers**:\n  ```bash\n  docker stop $(docker ps -aq)\n  ```\n- **Remove all containers**:\n  ```bash\n  docker container prune -f\n  ```\n\n### **View Logs**\n- Follow logs for the `token-redis` container:\n  ```bash\n  docker logs --follow token-redis\n  ```\n\n### **Connect to Redis via Shell**\n- Execute a shell command to connect to Redis:\n  ```bash\n  docker exec -it token-redis redis-cli\n\n## **Download DBeaver for Windows**\n\n1. Go to the official DBeaver download page: [DBeaver Download](https://dbeaver.io/download/).\n2. Select the **Windows** version (typically **Windows 64-bit**).\n3. The installer will be downloaded as an `.exe` file.\n\n### **Run the Installer**\n\n1. Locate the downloaded `.exe` file and double-click to run the installer.\n2. The **DBeaver Setup Wizard** will appear. Follow the on-screen instructions:\n   - Choose the installation directory or leave the default.\n   - Select additional options, such as whether to create shortcuts on the Start Menu and Desktop.\n\n### **Complete the Installation**\n\n1. Once the installation is complete, click **Finish**.\n2. DBeaver will launch automatically, or you can open it from the Start Menu or Desktop.\n\n### **Configure DBeaver**\n\n1. Upon first launch, you will be prompted to configure some initial preferences:\n   - Select your preferred UI theme (light or dark).\n   - Choose any additional plugins or settings you want to configure.\n2. After setting up, you can start connecting to your databases.\n\n---\n\n## **Installation on Linux**\n\nThere are installation methods for both **Debian-based** distributions (such as Ubuntu) and **RPM-based** distributions (such as Fedora). Additionally, you can install DBeaver via **Snap** or **Flatpak**.\n\n### **Debian-based Distributions (e.g., Ubuntu, Linux Mint)**\n\n1. **Download the .deb Package**\n   - Visit the official DBeaver download page: [DBeaver Download](https://dbeaver.io/download/).\n   - Choose the **Debian (64-bit)** version for your system.\n\n2. **Install the .deb Package**\n   - Open a terminal and navigate to the folder where the `.deb` file was downloaded.\n   - Run the following command to install DBeaver:\n     ```bash\n     sudo dpkg -i dbeaver-ce_\u003cversion\u003e.deb\n     ```\n   - If there are any missing dependencies, run:\n     ```bash\n     sudo apt-get install -f\n     ```\n\n3. **Run DBeaver**\n   - Once the installation is complete, you can launch DBeaver from the application menu or run it from the terminal:\n     ```bash\n     dbeaver\n     ```\n\n### **RPM-based Distributions (e.g., Fedora, CentOS, RHEL)**\n\n1. **Download the .rpm Package**\n   - Visit the official DBeaver download page: [DBeaver Download](https://dbeaver.io/download/).\n   - Choose the **RPM (64-bit)** version for your system.\n\n2. **Install the .rpm Package**\n   - Open a terminal and navigate to the folder where the `.rpm` file was downloaded.\n   - Run the following command to install DBeaver:\n     ```bash\n     sudo rpm -i dbeaver-ce-\u003cversion\u003e.rpm\n     ```\n\n3. **Run DBeaver**\n   - After installation, you can run DBeaver from the application menu or execute it via the terminal:\n     ```bash\n     dbeaver\n     ```\n\n### **Using Snap or Flatpak**\n\nYou can also install DBeaver using **Snap** or **Flatpak** on Linux.\n\n#### **Install using Snap**:\n1. Open a terminal and run:\n   ```bash\n   sudo snap install dbeaver-ce\n   \n## :zap: Technologies\t\n\n- Java\n-  Spring Boot\n- API REST\n- PostgreSQL (Container)\n- Docker\n-  Docker-compose\n- JWT\n- Token\n\n## :memo: Developed features\n\n- [x] Login Validation\n- [x] Logout Validation\n- [x] Token Validation\n\n\n## :technologist:\t Author\n\nBy Ramon Becker 👋🏽 Get in touch!\n\n\n\n[\u003cimg src='https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg' alt='github' height='40'\u003e](https://github.com/RamonBecker)  [\u003cimg src='https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/linkedin.svg' alt='linkedin' height='40'\u003e](https://www.linkedin.com/in/https://www.linkedin.com/in/ramon-becker-da-silva-96b81b141//)\n![Gmail Badge](https://img.shields.io/badge/-ramonbecker68@gmail.com-c14438?style=flat-square\u0026logo=Gmail\u0026logoColor=white\u0026link=mailto:ramonbecker68@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonbecker%2Fms-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framonbecker%2Fms-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonbecker%2Fms-auth/lists"}