Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAAS vs Spring securit..

 
Geeta Puttappanavar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my project I got a requirement to implement security and the project is using spring.

But I am confused between JAAS and spring.

Can any of you help me please to clear these confusions?

1. What are the differences between spring security and JAAS security?

2. To achieve the security is it necessary to use JAAS in spring or spring provides some API to implement the authentication and authorization?

3. If the answer is yes to use JAAS with spring , then we can authenticate the user as follow:

If(form.userName.equals(db.user_name)){
Returs true;
}
Else{
Return false
}
Without JAAS.
Then Why to use JAAS? What are the advantages of using it?


Thanks in advance
Geeta
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAAS is one of the authentication providers that Spring can use. Note that JAAS works at a lower level than web-application. It has hooks (if that is the right term) into the application server and operating system. Spring Security works in the application layer. It has its own authentication API that is very good and does not need to use JAAS. Often an existing JAAS provider is used when Spring security is implemented. In most cases, a new project would not be enhanced by using JAAS.

Spring Security based on ACEGI and ACEGI vs JAAS was covered: http://www.coderanch.com/t/134325/Security/ACEGI-JAAS
 
Geeta Puttappanavar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim McGuire wrote:JAAS is one of the authentication providers that Spring can use. Note that JAAS works at a lower level than web-application. It has hooks (if that is the right term) into the application server and operating system. Spring Security works in the application layer. It has its own authentication API that is very good and does not need to use JAAS. Often an existing JAAS provider is used when Spring security is implemented. In most cases, a new project would not be enhanced by using JAAS.

Spring Security based on ACEGI and ACEGI vs JAAS was covered: http://www.coderanch.com/t/134325/Security/ACEGI-JAAS



Thanks alot for the response Tim. As of now I am implementing Spring Security.

Can you please help me to write customized UserDetailsService.

1. I should implement UserDetailsService by some separate service class or by Dao class to give implementation for loadUserByUsername method?
2. In loadUserByUsername() method we provide only the user name and where to provide password?
ex in below code I am not providing the password.


How the spring comes to know about the credentials?
Request you to explain with ex.


Regards,
Geeta
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic