{"id":24750533,"url":"https://github.com/rogelioolarte/multiple-auth-api","last_synced_at":"2025-08-16T05:36:58.460Z","repository":{"id":274292036,"uuid":"922423824","full_name":"rogelioolarte/multiple-auth-api","owner":"rogelioolarte","description":"Spring Boot App that focuses on implementing multiple authentication methods using OAuhth2 and JWT.","archived":false,"fork":false,"pushed_at":"2025-08-10T02:24:39.000Z","size":1217,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-10T04:16:23.426Z","etag":null,"topics":["jwt","multiple-authentication","oauth2","register-login","security","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rogelioolarte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-01-26T06:48:16.000Z","updated_at":"2025-04-12T19:29:51.000Z","dependencies_parsed_at":"2025-02-11T23:23:07.026Z","dependency_job_id":"d0b07e79-010b-4c16-bcf9-01bbe23d69fa","html_url":"https://github.com/rogelioolarte/multiple-auth-api","commit_stats":null,"previous_names":["rogelioolarte/multiple-auth-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rogelioolarte/multiple-auth-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogelioolarte%2Fmultiple-auth-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogelioolarte%2Fmultiple-auth-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogelioolarte%2Fmultiple-auth-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogelioolarte%2Fmultiple-auth-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogelioolarte","download_url":"https://codeload.github.com/rogelioolarte/multiple-auth-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogelioolarte%2Fmultiple-auth-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270672363,"owners_count":24625953,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["jwt","multiple-authentication","oauth2","register-login","security","spring","spring-boot"],"created_at":"2025-01-28T09:08:16.570Z","updated_at":"2025-08-16T05:36:58.435Z","avatar_url":"https://github.com/rogelioolarte.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# multiple-auth-api\nSpring Boot App that focuses on implementing multiple authentication methods using OAuhth2 and JWT.\n\n## Introduction to the project\nThe repository contains a Springboot application for users to **login and register** using email and password or using OAuth2 (Google).\nThe backend app is meant to be run together with the frontend Angular application.\n\n## Technologies used\n- **Backend**\n    - Application is built using Java 21, Spring Boot 3 and Spring Security. Dependencies are managed using Maven. Authentication is done using JWT.\n- **Database**\n    - Postgresql is used as the database.\n\n## Steps to run the applications\n - Note: Use a terminal with bash to run the scripts.\n\n1. **Start up the database and environment variables:**\n - Run the following script to create the security variables:\n \n `./generate_keys.sh`\n\n - Create your credentials for using oauth2 in the google cloud console or follow the steps detailed [here](https://blog.devgenius.io/part-3-implementing-authentication-with-spring-boot-security-6-oauth2-and-angular-17-via-8716646ed062).\n\n - Run Postgresql docker container with the following command (replace _{PASSWORD}_ with your own password):\n\n `docker run --name multiple-auth-app-postgres -e POSTGRES_PASSWORD={PASSWORD} -d -p 127.0.0.1:5432:5432 postgres`\n\n Don't change the port configuration when running in a local environment. The syntax of the mapping is for extra security, so that the database is not accessible from outside the container.\n\n If you change the password to the postgresql database, make sure to update the password in the application.properties file of the **_multiple-auth-api_** project.\n - If you need to connect to the postgresql database container, run the following command:\n\n `docker exec -it multiple-auth-app-postgres bash`\n - Connect to postgresql database, once inside the container:\n `psql -U postgres`\n\n2. **Start up the multiple-auth-api:**\n - Note: It is **strongly recommended** to use an IDE for managing the .env file. Using the \"run.sh\" script for loading variables may have problems.\n\n - Run the following command from the root directory of the project (or just press the start button in your IDE (Recomended), remember to read the .env file):\n\n `./run.sh`\n\n - Default port for the _multiple-auth-api_ is 8080. If you want to change the port, set the \"server.port\" property in the _application.properties_ file. If you change the port, make sure to update the port in the multiple-auth-ui project as well (_constants.ts_ file, \"API_BASE_URL\" parameter).\n\n - As this project uses OAuth2, make sure to update the redirect-uri in the _application.properties_ file and in configurations at OAuth2 providers (Google, GitHub, Twitter, etc.) too.\n - If you checked out from _main_ branch, you will see that _application.properties_ contains references to environment variables. Make sure to edit a _.env_ file in the root of the project, and list all the required properties there as key-value pairs (don't forget to exclude this file from version control):\n ```\n DATABASE_USER=postgres\n DATABASE_PASSWORD=K29r8Dhc79n2gPG86CRhoVt9NBxTa0Gk\n ...\n ```\n3. **Start up the multiple-auth-ui:**\n    - Run the following command from the root directory of the project:\n\n      `npm install`\n    - Run the following command from the root directory of the project:\n\n      `npm run start`\n    - Default port for the multiple-auth-ui is 4200. If you want to change the port, update the port in the angular.json file. On the following path: _multiple-auth-ui -\u003e architect -\u003e serve_ add this:\n        ```\n        \"options\": {\n            \"port\": [desired-port]\n        }\n        ```\n        - Make sure to update authorized redirect uri usage places in the _multiple-auth-api_ too.\n\n## Are you curious about the development process? \nThe use of oauth2 has been implemented according to the following repository, if you find this project useful, please visit the following repository and follow the step-by-step creation project:\nYou can find the corresponding repository [here](https://github.com/anitalakhadze/multiple-auth-ui).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogelioolarte%2Fmultiple-auth-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogelioolarte%2Fmultiple-auth-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogelioolarte%2Fmultiple-auth-api/lists"}