User authentication service simply operates user actions such as authentication and authorization It produces Json Web Tokens for successfull operations.
Before run the application, you need to generate two files in order to configure the app
Create file named application.yml
under src/main/resources/
directory and fill it as follows:
java-jwt:
secret: YOUR SECRET HERE
issuer: YOUR ISSUER HERE
expiration: EXPIRATION TIMES IN SECONDS
spring:
datasource:
url: jdbc:postgresql://DB_URL/DB_NAME
username: DB_USERNAME
password: DB_PASSWORD
jpa:
hibernate:
ddl-auto: none
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
Create file named .env
inside root directory of project in order to configure database
DB_PASSWORD=DB_PASSWORD
DB_NAME=DB_NAME
DB_USER=DB_USER_NAME
You can create docker image with command:
docker build -t emakas-users .
After creation, you can start
POST:
/users/sign-up
Register new User{
"uname": "string",
"password": "string",
"eMail": "string",
"name": "string",
"surname": "string"
}
Response code | Description |
---|---|
201 | User created successfully |
400 | Wrong parameters in post body |
DELETE:
/users/delete/
Delete a userThis request does not need a body Header param:
Response code | Description |
---|---|
200 | User deleted successfully |
400 | Wrong parameters in request |
404 | User cannot be founded |