This Spring Boot application serves as a RESTful API for user authentication, providing validated endpoints for user login and registration. Additionally, it includes social media login functionality for GitHub, Facebook, and Google.
- User authentication through email and password
- User registration
- Social media login (GitHub, Facebook, Google)
Endpoint: POST /api/v1/auth/login
To authenticate a user, send a POST request with a JSON body containing the user's email and password.
Endpoint: POST /api/v1/auth/register
To register a new user, send a POST request with a JSON body containing the user's registration details.
The application supports social media login for GitHub, Facebook, and Google. To enable this feature, configure the respective authentication providers in the application properties.
Endpoint: POST /api/v1/auth/login/github
To perform GitHub login, send a POST request to the above endpoint. The application will redirect the user to GitHub for authentication, and upon successful authentication, the user will be redirected back to the application.
Endpoint: POST /api/v1/auth/login/facebook
To perform Facebook login, send a POST request to the above endpoint. The application will redirect the user to Facebook for authentication, and upon successful authentication, the user will be redirected back to the application.
Endpoint: POST /api/v1/auth/login/google
To perform Google login, send a POST request to the above endpoint. The application will redirect the user to Google for authentication, and upon successful authentication, the user will be redirected back to the application.
Please ensure that you have the necessary API keys and credentials configured in the application for each social media platform.
POST /api/v1/auth/login
: Authenticate userPOST /api/v1/auth/register
: Register a new user
{
"email": "[email protected]",
"password": "securepassword"
}
{
"token": "token-example",
}
{
"message": "Invalid user credentials"
}
{
"firstName": "first name example",
"lastName": "last name example",
"email": "[email protected]",
"password":"********"
}
{
"token": "token-example",
}