• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to authenticate REST request against database by Spring Security by Java Configuration  RSS feed

 
Ajharul Abedeen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am near to mad. I have to launch a project very soon. For the last few days i am searching and searching but unable to reach a conclusion. I am using AngualrJs, SpringBoot.
My requirement is that user will enter there user name and password, the user name and password will be authenticated against the data base and the user will be logged in. The password will be encrypted by some algorithms like "bcrypt" encryption.
It is a from type site.  For this moment it is enough just authenticating. I found some examples, most of them are in XML configuration and inMemoryAuthentication.
Would any one provide me  an example where a REST request coming from AngularJS will be authenticated against Database and after authentication a success message will be returned and also the log out facility will be there. I use maven.
OR is there any way that the XML security configuration can be loaded in to SpringBoot Application. 
 
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajharul Abedeen wrote:The password will be encrypted by some algorithms like "bcrypt" encryption.

Hashed, not encrypted.

Spring Security allows you to perform JDBC authentication. You need a DataSource in your application that you will use to access your database. Then you configure Spring to authenticate your users using this DataSource.

You then need to authorize users to perform certain requests.

Find the complete reference here: http://docs.spring.io/spring-security/site/docs/4.2.3.BUILD-SNAPSHOT/reference/htmlsingle/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!