/spring-boot-swagger-ui-basic-auth

Demo Spring Boot app showing Swagger UI secured with Basic Authentication

Primary LanguageJavaThe UnlicenseUnlicense

spring-boot-swagger-ui-basic-auth

keep_growing logo

About this project

This Spring Boot project shows an example configuration of Spring Security and OpenAPI that ensures that only authenticated users can call endpoints available through Swagger UI:

swagger ui with basic auth for endpointsscreenshot

Prerequisites

  • JDK 13+
  • Maven (or you can use mvnw provided in the project)

Getting started

First, clone this repository.

Then, build it locally with:

mvn clean install

You can run the app in a command line with:

mvn spring-boot:run

Visit API documentation

Default credentials

  • username: spring
  • password: spring

Features

  • Spring Security
  • Basic Authentication in Swagger UI
  • OpenAPI 3 specification

Built With