Reputation: 6244
I've a client/server app using Spring and more specifically Spring Security to manage authentication of clients. All works fine and this is the relevant part of the configuration:
<security:authentication-manager id="authenticationManager">
<security:authentication-provider>
<security:password-encoder hash="md5" />
<security:jdbc-user-service data-source-ref="dataSource" users-by-username-query="
select username,password,attivo
from Operatore where username=?"
authorities-by-username-query="
select username,ruolo
from Operatore where username=? " />
</security:authentication-provider>
</security:authentication-manager>
My question if there is a way to authorize users that uses passepartout password. I mean, sometimes is confortable login in the software with a particular user using a super-admin password in order to see exaclty what the user see without change his password.
I think this behaviour is not contemplated from Spring; there is a way to achieve this behaviour?
Upvotes: 0
Views: 129
Reputation: 23226
You can write your own Authentication logic simply by wiring in your own implementation of an AuthenticationProvider and implementing the authenticate method as required:
Further reading:
http://www.baeldung.com/spring-security-authentication-provider
https://danielkaes.wordpress.com/2013/02/20/custom-authentication-provider-in-spring/
https://dzone.com/articles/spring-security-custom
Upvotes: 1