I am working with a legacy application that stored passwords in plaintext. I have ported the application to spring 3 mvc + security. I have also successfully gotten spring security handling the authentication and authorization using sha256 + a salt based on the username. This all works great, however as part of the deployment, I will need to migrate the existing database to use the new password schema. I am not sure how spring security does it's password hashing with a salt, so i am unable to write a sql script that can be used to migrate the old plaintext passwords to the new sha256+salt schema. Is there any documentation or resources that I can use to figure this out?
Spring security password hash + salt
7.9k Views Asked by vikash dat At
2
There are 2 best solutions below
0
madth3
On
- If you are using the default password encode then the source seems useful. (Pick the branch appropiate for the version you are using).
- You can implement your own PasswordEncoder and define the way the salt is used.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in SPRING
- Redirect inside java interceptor
- Spring RestTemplate passing the type of the response
- spring-integration-dsl-groovy-http return null when i use httpGet method
- Custom Spring annotation for request parameters
- Spring - configure Jboss Intros for xml with java config?
- HTTP Status 404 - Not Found in Spring 3.2.7
- AndroidAnnotations how to use setBearerAuth
- android I/O error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
- Show login dialog when not authenticated yet
- Spring Data Rest supporting json and xml
- @Value annotation not resolved in a class that belongs to dependency jar
- Remove nested _embedded fields while using projections
- How to send Rest GET request that contains "#" value in url parameters?
- How to inject spring bean into Validator(hibernate)
- How to keep a variable in the URL when using Spring LocaleChangeInterceptor
Related Questions in SPRING-SECURITY
- AndroidAnnotations how to use setBearerAuth
- Show login dialog when not authenticated yet
- LDAP user attributes from CAS
- Spring security /j_spring_security_login 404 error
- Use thymeleaf template for some pages and rest for some for building gradle project
- Spring MVC + Tiles + Spring Security = The requested resource is not available
- The type javax.servlet.ServletContext and javax.servlet.ServletException cannot be resolved
- Intercepting springsecurity behavior in grails
- Basic Auth to Receive Token in Spring Security
- Spring LDAP Context.REFERRAL to follow
- Fail to locate j_spring_security_check in Spring Security
- Accessing resource with expired bearer token fails with 500 http code
- Spring security not authenticate the user
- Remove "Using default security password" on Spring Boot
- Is a SecurityContext shared between requests when using Spring Security?
Related Questions in SALT
- Trouble validating md5 hashed password with randomly generated salt?
- Xcode salting and hashing a password
- Generate SSHA password in PHP to use ldap_compare for OpenLDAP SSHA passwords
- Generating Unique Invoice tracking in dot net
- salt created by Java SecureRandom has different getBytes() value
- Is this a bad practice for storing passwords in PHP?
- Error Hashing + Salt password
- Passwd command linux
- PHP - Unable to login after password reset with sha512
- Java encryption with sha256 and salt
- create md5 hash (salt+value)
- Hash + salt&pepper + Forward relationship
- salts stored wrong in database.!
- What is the Security Risk of Giving Away Both the Salt and Encrypted Password?
- Securing users passwords using c# - Rfc2898DeriveBytes vs SHA512
Related Questions in SALTEDHASH
- Generating Unique Invoice tracking in dot net
- Salted Password Hashing. Am I doing it right in ASP.NET environment?
- One way functions, Hash algorithms
- Trying to understand salting and hashing passwords in Ruby on Rails
- Spring security password hash + salt
- Should I send salt value to web browser to secure password
- Hashing using salt on android and iphone
- PEPPER in a backend Flask app throwing KeyError: 'PEPPER'
- Where to get salt when hashing passwords?
- What is the purpose of the "salt" when hashing?
- how to authentificate user with salt passeword sha-1 with tomcat 7
- Having trouble with apache shiro saltedauthentication.hashProvidedCredentials not given expected hash
- Salted Hash Password Authentication
- data and salt argument with bcrypt
- Unable to login while using salt for password hashing in cakephp3x
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This is documented in
BasePasswordEncoder:So in your case you can compute the salted password using this simple code:
Note:
ShaPasswordEncoderextendsBasePasswordEncoder.