BAEL-6303: Encode passwords with Spring Boot CLI

This commit is contained in:
achraftt
2023-04-23 18:59:19 +02:00
parent bbbe9195ed
commit 2efc27170d
5 changed files with 117 additions and 0 deletions
@@ -0,0 +1,12 @@
package com.baeldung;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@@ -0,0 +1,13 @@
package com.baeldung.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class LoginController {
@GetMapping("/")
public String hello() {
return "Hello World!";
}
}
@@ -0,0 +1,3 @@
spring.security.user.name=baeldung
# Encoded password with SpringBoot CLI, the decoded password is baeldungPassword
spring.security.user.password={bcrypt}$2y$10$R8VIwFiQ7aUST17YqMaWJuxjkCYqk3jjPlSxyDLLzqCTOwFuJNq2a