1

I am looking some example for integration of latest Spring framework security with Hibernate based on annotation( ie JPA) with user credential from the DB. How can I do this? can I go for password encoding and decoding with Spring?

One of the solution available is with link here but this is based on Spring 2.5 with XML configuration. I want to avoid xml and use annotation.

1 Answer 1

2

Use Spring source documentation. Everything you needed is given on documentation. And yeah! you can go with password encoding and decoding with spring. Just write your encoding class which will extend the org.springframework.security.authentication.encoding.MessageDigestPasswordEncoder.

public class MyPassEncoder extends org.springframework.security.authentication.encoding.MessageDigestPasswordEncoder { MyPassEncoder(){ super("MD5"); } public String encodePassword(String rawPass, Object salt) { String encPass = super.encodePassword(rawPass, salt); return encPass; } } 
Sign up to request clarification or add additional context in comments.

2 Comments

there is no example given in that document for Spring security with Hibernate based on Annotation concept.
download examples from spring security documentation - chapter no. 4 static.springsource.org/spring-security/site/docs/3.1.x/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.