This project is an OAuth2 server built using the Symfony framework. It uses the CQRS (Command Query Responsibility Segregation) pattern, DDD (Domain-Driven Design), API Platform, and PostgreSQL database. The goal of this project is to provide a secure and scalable authorization and authentication service for web and mobile applications.
| Version | Coding Name | Release Date | Notes |
|---|---|---|---|
| 0.9 | BetaWave | 29.06.2024 | Initial release candidate |
| 1.0 | TBD | TBD | Stable release |
- Docker and Docker Compose
- PHP 8.2 or higher (inside Docker container)
- Symfony 6.4
- PostgreSQL 14 or higher (inside Docker container)
-
Clone the repository
git clone https://github.com/sean6224/Oauth_Server.git cd Oauth_Server -
Changing URL and Reverse Proxy (Traefik)
-
To change your localhost address, modify
SERVER_NAMEandTRUSTED_HOSTSin the.envfile. Always use.localhostas part of the address. For example, if you haveoauth.needrise.localhostand want to change it tologin.company.localhost, set it accordingly. -
To change Traefik's address, update the
docker/traefik/traefik.config.ymlfile (traefik.config.yml). ModifyHost('traefik.needrise.localhost')undertraefik-dashboardandHost('oauth.needrise.localhost')underapi. Ensure you follow the same address rule as mentioned above. -
Remember to update the address in the
generate-localhost-certs.shscript.
-
-
Configure the Database
Configure the PostgreSQL database connection in the
.envfile:DATABASE_NAME=rse DATABASE_HOST=database DATABASE_USER=root DATABASE_PASSWORD=dl5rXGLyyYQ6xcoi
DATABASE_NAME: Name of the PostgreSQL database.DATABASE_HOST: Hostname of the PostgreSQL database (the service name fromdocker-compose.yml).DATABASE_USER: Username for the PostgreSQL database.DATABASE_PASSWORD: Password for the PostgreSQL database.
-
Changing the Appearance of Twig Templates
To modify Twig templates, navigate to the Presentation/Templates directory.
-
Change Configurations for Sending Email in
.envConfigure email settings in the
.envfile for Symfony Mailer:###> symfony/mailer ### MAILER_NAME=CompanyName MAILER_FROM_ADDRESS=setemail@setemail.com ###< symfony/mailer ### ###> symfony/google-mailer ### # Gmail SHOULD NOT be used in production, use it in development only. MAILER_DSN=gmail+smtp://test:set@default ###< symfony/google-mailer ###
MAILER_NAME: Name of your mailer.MAILER_FROM_ADDRESS: Default sender email address.MAILER_DSN: Symfony Mailer DSN (Data Source Name) for Gmail in development environment.
-
Oauth Server Commands
- Installation of oauth server:
make install
- Stopping oauth server:
make stop
- Running oauth server:
make start
- Installation of oauth server:
-
Accessing Services
If you want to contribute to the project, please open an issue or pull request on GitHub. We welcome contributions from the community!
This project is licensed under the MIT License. See the LICENSE file for more details.