Sample Spring Boot Basic Auth Server
- Java 11
- IDEA (IntelliJ IDEA or Eclipse)
To build the project, run the below command
./gradlew clean build
We can run the project using gradle task
./gradlew :bootRun
Credentials for accessing the endpoint are:
username: admin
password: password
Equivalent Basic auth header for these credentials is:
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Http GET endpoints:
GET /secured/hello
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Http POST endpoint:
POST /secured/hello
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Body: {"name": "test"}