aspose file tools*
The moose likes Security and the fly likes JAAS vs Spring securit.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "JAAS vs Spring securit.." Watch "JAAS vs Spring securit.." New topic
Author

JAAS vs Spring securit..

Geeta Puttappanavar
Ranch Hand

Joined: Jan 18, 2012
Posts: 43
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

Joined: Apr 30, 2003
Posts: 820

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

Joined: Jan 18, 2012
Posts: 43
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAAS vs Spring securit..