Skip to content

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

License

Notifications You must be signed in to change notification settings

joaogcs/spring-kotlin-api-oauth2-with-db

Repository files navigation

Spring Kotlin API Oauth2 with PostgreSQL

Actions Status Semantic Release GitHub Open in Visual Studio Code

This API was developed using the stacks:

  • Kotlin 1.6
  • JVM 11
  • 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_BUILDKIT=1 docker-compose -f ./docker/local/postgresql/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.html

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

API Credentials

client-id: your-client-id

client-secret: your-client-secret

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages