Welcome to the Auth MS repository, a robust authentication microservice designed to operate as a Software as a Service (SaaS) solution. This service provides secure authentication capabilities via API calls, eliminating the need for local installations.
- Application-based Authentication: Register applications to obtain unique credentials.
- Secure API Integration: Easily integrate with various platforms using provided endpoints.
- Scalable and Modular: Designed with scalability and maintainability in mind.
- Node.js: Version 16 or higher.
- Docker: Installed and running (optional but recommended).
- Environment Variables: Defined in an
.envfile (use.env.templateas a reference).
git clone <repository-url>
cd auth-msnpm install- Copy the
.env.templatefile to.env:cp .env.template .env
- Edit
.envto include your specific configuration values.
npm start- Build the Docker image:
docker-compose build
- Run the container:
docker-compose up
- Create Application:
POST /api/applications
{
"name": "MyApp",
"description": "Description of MyApp"
}{
"id": "unique-id",
"name": "MyApp",
"credentials": {
"clientId": "client-id",
"clientSecret": "client-secret"
}
}- Authenticate User:
POST /api/auth
{
"clientId": "client-id",
"clientSecret": "client-secret",
"username": "user",
"password": "pass"
}{
"token": "jwt-token",
"expiresIn": 3600
}For a complete list of endpoints and their usage, refer to the API documentation (future feature).
- Use TypeScript for all development.
- Follow the existing folder structure:
src/core: Core business logic.src/providers: Service integrations.src/utils: Utility functions.src/shared: Shared components and configurations.
Add and run tests to ensure functionality:
npm testWe welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed explanation of your changes.
- Implement detailed API documentation.
- Add unit and integration tests.
- Enhance security measures, such as rate limiting and IP whitelisting.
- Introduce multi-factor authentication (MFA).
This project is licensed under the MIT License.