Skip to content

Example of user authentication (Oauth2) in Kotlin with Spring Security and PostgreSQL

License

Notifications You must be signed in to change notification settings

joaogcs/spring-kotlin-api-basic-auth-with-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Kotlin API Basic Authentication with Database

Actions Status Semantic Release GitHub Open in Visual Studio Code

This API was developed using the stacks:

  • Kotlin 1.7
  • JVM 18
  • Spring Boot
  • Maven
  • Docker
  • Swagger
  • jUnit5
  • Mockito

How to run

First make sure that you have installed the docker-compose, run docker-compose command to build local postgresql database:

$ docker-compose -f ./docker/local/h2/docker-compose.yml up -d

Then run the application:

$ ./mvnw spring-boot:run

To access the project documentation, access the url:

http://localhost:8080/swagger-ui

How to check API health

To check API health you must GET url (authentication needed):

http://localhost:8080/actuator/health

How to run tests

$ ./mvnw test

How to playground

You can play in localhost either by Swagger or importing postman collection.

Users

Administrator username/password: admin/pass

Common user username/password: user/pass

About

Example of user authentication (Oauth2) in Kotlin with Spring Security and PostgreSQL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages