• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

[Newbie] - Spring Security, Custom Login

 
Ranch Foreman
Posts: 55
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question
How do I set up a custom login with Spring Boot? I need to use the same connection method of a legacy app I have.




Things to know before I explain

-I have a javafx App that connects to a data base using a php website as proxy/Login
-Obviously, this javafx app has the User class already defined.
-The javafx  application logs in with the web service and retrieves the database URL.
-The javafx  application uses the database URL to access a database directly.

Or, to simplify: The user put the login and password and click LOGIN -> The app,  goes to the webhost, sends the data to a certain php file and requests the database url and data that comes ENCRYPTED through JASPYR and it also comes through https. Once the data is returned, we decrypt it and login to the database directly.


-Im building a SpringBoot application to work with this legacy app.


Where Am I stuck?

I have built a Spring boot maven project and im reading a lot about Spring boot. My first step is to create a login page that behaves as the legacy app.

Currently, Im using a InMemorySecurityConfig as follows:




I dont know how to start. I think I have to find away to define the correct User model and then use a class to login that actually allows me to manually login.




Here is the legacy class that I use on my javafx App below. How do I start to convert this to spring boot? Please help.







How do I start? Any tips on how to start is greatly appreciated.

Im expecting that I have to somehow tell spring boot which User class to use, to tell spring to NOT instantly connect to the database and wait for the database info to be retrieved by the login page, and a way to login using spring.




The following topic explains my login process: https://coderanch.com/t/731125/engineering/Encrypt-JAVA-jasypt-Decrypt-PHP


PS: If the topic is not clear, please let me know. English isnt my first language but im trying my best.
#ThisForumRocks



References:
https://coderanch.com/t/735809/frameworks/User-Authentication-Authorization-Spring-Boot

https://spring.io/guides/gs/securing-web/

https://coderanch.com/t/734572/databases/Changing-database-DNS-Cname-adjustment
 
Castiel Snow
Ranch Foreman
Posts: 55
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I came up with a partial solution.

What Im planning to do is:

-Connect the spring boot directly to the login schema.
-Set up spring boot to use my custom User class.

-Login

-Change schema based on the login information.

--
Im a bit stuck on this part:
-Change schema based on the login information.

I found some information regarding people wanting to use 2 or 3 databases but in my case, it could be 'n' schemas GLOBALLY depending on which user log-in.






 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic