Is it possible to read console input just before the embedded tomcat on the spring boot starts? The supposedly application flow is, request username and password from the user,
Get username and password in shell script before executing your java program and pass those as argument to your application.
#!/bin/bash
# Ask login details
read -p 'user: ' uservar
read -sp 'password: ' passvar
echo
Now you have user and password you can run java command with nohup and pass user password as jvm properties. You can also pass user and password as program arguments as suggested in other answer.
Like nohup java -jar abc.jar -Duser=$user -Dpassword=$password
And fetch these properties using
String user = System.getProperty("String");
String password = System.getProperty("password");