Spring Boot How to check if encoded password from db is matching with password from a form before an update












0















I implement a method inside my update method for check if the given password in a UpdateForm is matching with an encoded password from db.

I didn't found any tutorial or solution already but I've tried some stuff but nothing work.

This is my update method



@RequestMapping(value = {"/home/editUser"}, method = RequestMethod.POST)
public String home(@ModelAttribute("editUser") User editUser, Model model) {
logger.info("/home/editUser");
try {
User user = userService.findById(editUser.getId());
if (!user.equals(editUser)) {
//old password matching
if (user.getPassword_1() == editUser.getPassword_1()) {
//encode new password
editUser.setPassword(PassEncoding.getInstance().passwordEncoder.encode(editUser.getPassword()));
//update
userService.update(editUser);
model.addAttribute("msg", "success");
}
else {
System.out.println("not match");
}
} else {
model.addAttribute("msg", "same");
}
} catch (Exception e) {
model.addAttribute("msg", "fail");
logger.error("editUser: " + e.getMessage());
}
model.addAttribute("home", editUser);
return "home";
}


Password_1 is my oldpassword (actual) , but I don't know how I can implement the password encoder and it gives




not match




Thanks in advance for help :)



I've just tried



if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword_1()))


but it gives




not match




It's work with



if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword()))


Thanks a lot !










share|improve this question





























    0















    I implement a method inside my update method for check if the given password in a UpdateForm is matching with an encoded password from db.

    I didn't found any tutorial or solution already but I've tried some stuff but nothing work.

    This is my update method



    @RequestMapping(value = {"/home/editUser"}, method = RequestMethod.POST)
    public String home(@ModelAttribute("editUser") User editUser, Model model) {
    logger.info("/home/editUser");
    try {
    User user = userService.findById(editUser.getId());
    if (!user.equals(editUser)) {
    //old password matching
    if (user.getPassword_1() == editUser.getPassword_1()) {
    //encode new password
    editUser.setPassword(PassEncoding.getInstance().passwordEncoder.encode(editUser.getPassword()));
    //update
    userService.update(editUser);
    model.addAttribute("msg", "success");
    }
    else {
    System.out.println("not match");
    }
    } else {
    model.addAttribute("msg", "same");
    }
    } catch (Exception e) {
    model.addAttribute("msg", "fail");
    logger.error("editUser: " + e.getMessage());
    }
    model.addAttribute("home", editUser);
    return "home";
    }


    Password_1 is my oldpassword (actual) , but I don't know how I can implement the password encoder and it gives




    not match




    Thanks in advance for help :)



    I've just tried



    if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword_1()))


    but it gives




    not match




    It's work with



    if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword()))


    Thanks a lot !










    share|improve this question



























      0












      0








      0








      I implement a method inside my update method for check if the given password in a UpdateForm is matching with an encoded password from db.

      I didn't found any tutorial or solution already but I've tried some stuff but nothing work.

      This is my update method



      @RequestMapping(value = {"/home/editUser"}, method = RequestMethod.POST)
      public String home(@ModelAttribute("editUser") User editUser, Model model) {
      logger.info("/home/editUser");
      try {
      User user = userService.findById(editUser.getId());
      if (!user.equals(editUser)) {
      //old password matching
      if (user.getPassword_1() == editUser.getPassword_1()) {
      //encode new password
      editUser.setPassword(PassEncoding.getInstance().passwordEncoder.encode(editUser.getPassword()));
      //update
      userService.update(editUser);
      model.addAttribute("msg", "success");
      }
      else {
      System.out.println("not match");
      }
      } else {
      model.addAttribute("msg", "same");
      }
      } catch (Exception e) {
      model.addAttribute("msg", "fail");
      logger.error("editUser: " + e.getMessage());
      }
      model.addAttribute("home", editUser);
      return "home";
      }


      Password_1 is my oldpassword (actual) , but I don't know how I can implement the password encoder and it gives




      not match




      Thanks in advance for help :)



      I've just tried



      if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword_1()))


      but it gives




      not match




      It's work with



      if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword()))


      Thanks a lot !










      share|improve this question
















      I implement a method inside my update method for check if the given password in a UpdateForm is matching with an encoded password from db.

      I didn't found any tutorial or solution already but I've tried some stuff but nothing work.

      This is my update method



      @RequestMapping(value = {"/home/editUser"}, method = RequestMethod.POST)
      public String home(@ModelAttribute("editUser") User editUser, Model model) {
      logger.info("/home/editUser");
      try {
      User user = userService.findById(editUser.getId());
      if (!user.equals(editUser)) {
      //old password matching
      if (user.getPassword_1() == editUser.getPassword_1()) {
      //encode new password
      editUser.setPassword(PassEncoding.getInstance().passwordEncoder.encode(editUser.getPassword()));
      //update
      userService.update(editUser);
      model.addAttribute("msg", "success");
      }
      else {
      System.out.println("not match");
      }
      } else {
      model.addAttribute("msg", "same");
      }
      } catch (Exception e) {
      model.addAttribute("msg", "fail");
      logger.error("editUser: " + e.getMessage());
      }
      model.addAttribute("home", editUser);
      return "home";
      }


      Password_1 is my oldpassword (actual) , but I don't know how I can implement the password encoder and it gives




      not match




      Thanks in advance for help :)



      I've just tried



      if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword_1()))


      but it gives




      not match




      It's work with



      if(PassEncoding.getInstance().passwordEncoder.matches(editUser.getPassword_1(), user.getPassword()))


      Thanks a lot !







      java spring-boot spring-security spring-data-jpa






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 28 '18 at 10:42







      Mez Rbk

















      asked Nov 28 '18 at 10:12









      Mez RbkMez Rbk

      66




      66
























          3 Answers
          3






          active

          oldest

          votes


















          1














          you can use org.springframework.security.crypto.password.PasswordEncoder



          @Autowired
          private final PasswordEncoder passwordEncoder;
          ....
          ....
          boolean result = passwordEncoder.matches(password_plan_text_here, encoded_password_here);


          refer below link for more info https://docs.spring.io/spring-security/site/docs/4.2.4.RELEASE/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html



          You need to choose correct encoder as below.



          @Bean
          public PasswordEncoder passwordEncoder() {
          return new BCryptPasswordEncoder();
          }





          share|improve this answer


























          • Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

            – Mez Rbk
            Nov 28 '18 at 10:28











          • I edit with your solution but it gives same error :/

            – Mez Rbk
            Nov 28 '18 at 10:36






          • 1





            When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

            – darshakat
            Nov 28 '18 at 10:37











          • You need to choose same encoder which you use to encode the password. I'll update the answer.

            – darshakat
            Nov 28 '18 at 10:40











          • ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

            – Mez Rbk
            Nov 28 '18 at 10:41



















          1














          You can implement this like bellow



          If you want, You can use this annotation in controller argument to make sure your user is authenticated.



          @AuthenticationPrincipal User user
          .........
          .........


          Use this method like structure to check your password is matched or not. It return true value if it is matched.



          import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
          import org.springframework.security.crypto.password.PasswordEncoder;

          ..........
          ..........


          Your input password is "password" that you make to match with DB user find by



          User user = userService.findById(editUser.getId());

          public boolean userPasswordCheck(String password, User user) {

          PasswordEncoder passencoder = new BCryptPasswordEncoder();
          String encodedPassword = user.getPassword();
          return passencoder.matches(password, encodedPassword);
          }





          share|improve this answer































            0














            You have to encode the local password before compare it with the db password.



            The most easy method is to HASH the pass in MD5 in that way the HASH never change and you can compare the pass without error.



            I hope it's what you asking for, let me know if you want more help. (Code or another).






            share|improve this answer


























            • I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

              – Mez Rbk
              Nov 28 '18 at 10:24











            • It's ok it solved

              – Mez Rbk
              Nov 28 '18 at 10:41











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53516952%2fspring-boot-how-to-check-if-encoded-password-from-db-is-matching-with-password-f%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            you can use org.springframework.security.crypto.password.PasswordEncoder



            @Autowired
            private final PasswordEncoder passwordEncoder;
            ....
            ....
            boolean result = passwordEncoder.matches(password_plan_text_here, encoded_password_here);


            refer below link for more info https://docs.spring.io/spring-security/site/docs/4.2.4.RELEASE/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html



            You need to choose correct encoder as below.



            @Bean
            public PasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
            }





            share|improve this answer


























            • Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

              – Mez Rbk
              Nov 28 '18 at 10:28











            • I edit with your solution but it gives same error :/

              – Mez Rbk
              Nov 28 '18 at 10:36






            • 1





              When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

              – darshakat
              Nov 28 '18 at 10:37











            • You need to choose same encoder which you use to encode the password. I'll update the answer.

              – darshakat
              Nov 28 '18 at 10:40











            • ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

              – Mez Rbk
              Nov 28 '18 at 10:41
















            1














            you can use org.springframework.security.crypto.password.PasswordEncoder



            @Autowired
            private final PasswordEncoder passwordEncoder;
            ....
            ....
            boolean result = passwordEncoder.matches(password_plan_text_here, encoded_password_here);


            refer below link for more info https://docs.spring.io/spring-security/site/docs/4.2.4.RELEASE/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html



            You need to choose correct encoder as below.



            @Bean
            public PasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
            }





            share|improve this answer


























            • Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

              – Mez Rbk
              Nov 28 '18 at 10:28











            • I edit with your solution but it gives same error :/

              – Mez Rbk
              Nov 28 '18 at 10:36






            • 1





              When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

              – darshakat
              Nov 28 '18 at 10:37











            • You need to choose same encoder which you use to encode the password. I'll update the answer.

              – darshakat
              Nov 28 '18 at 10:40











            • ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

              – Mez Rbk
              Nov 28 '18 at 10:41














            1












            1








            1







            you can use org.springframework.security.crypto.password.PasswordEncoder



            @Autowired
            private final PasswordEncoder passwordEncoder;
            ....
            ....
            boolean result = passwordEncoder.matches(password_plan_text_here, encoded_password_here);


            refer below link for more info https://docs.spring.io/spring-security/site/docs/4.2.4.RELEASE/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html



            You need to choose correct encoder as below.



            @Bean
            public PasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
            }





            share|improve this answer















            you can use org.springframework.security.crypto.password.PasswordEncoder



            @Autowired
            private final PasswordEncoder passwordEncoder;
            ....
            ....
            boolean result = passwordEncoder.matches(password_plan_text_here, encoded_password_here);


            refer below link for more info https://docs.spring.io/spring-security/site/docs/4.2.4.RELEASE/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html



            You need to choose correct encoder as below.



            @Bean
            public PasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
            }






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 28 '18 at 10:41

























            answered Nov 28 '18 at 10:24









            darshakatdarshakat

            391111




            391111













            • Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

              – Mez Rbk
              Nov 28 '18 at 10:28











            • I edit with your solution but it gives same error :/

              – Mez Rbk
              Nov 28 '18 at 10:36






            • 1





              When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

              – darshakat
              Nov 28 '18 at 10:37











            • You need to choose same encoder which you use to encode the password. I'll update the answer.

              – darshakat
              Nov 28 '18 at 10:40











            • ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

              – Mez Rbk
              Nov 28 '18 at 10:41



















            • Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

              – Mez Rbk
              Nov 28 '18 at 10:28











            • I edit with your solution but it gives same error :/

              – Mez Rbk
              Nov 28 '18 at 10:36






            • 1





              When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

              – darshakat
              Nov 28 '18 at 10:37











            • You need to choose same encoder which you use to encode the password. I'll update the answer.

              – darshakat
              Nov 28 '18 at 10:40











            • ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

              – Mez Rbk
              Nov 28 '18 at 10:41

















            Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

            – Mez Rbk
            Nov 28 '18 at 10:28





            Does it need to be a new method or i can implement it in my update method for check before update ? I don't know how to use it for my problem ^^"

            – Mez Rbk
            Nov 28 '18 at 10:28













            I edit with your solution but it gives same error :/

            – Mez Rbk
            Nov 28 '18 at 10:36





            I edit with your solution but it gives same error :/

            – Mez Rbk
            Nov 28 '18 at 10:36




            1




            1





            When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

            – darshakat
            Nov 28 '18 at 10:37





            When you invoke findById, you will receive a User with encoded password and in 'editUser', editUser.getPassword_1() will give you the actual old password. so you can replace your "user.getPassword_1() == editUser.getPassword_1()" with the "passwordEncoder.matches(editUser.getPassword_1(), encoded_password_from_db)"

            – darshakat
            Nov 28 '18 at 10:37













            You need to choose same encoder which you use to encode the password. I'll update the answer.

            – darshakat
            Nov 28 '18 at 10:40





            You need to choose same encoder which you use to encode the password. I'll update the answer.

            – darshakat
            Nov 28 '18 at 10:40













            ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

            – Mez Rbk
            Nov 28 '18 at 10:41





            ok my bad i did something useless x) it work when i change the user.getPassword_1 with user.getPassword thanks

            – Mez Rbk
            Nov 28 '18 at 10:41













            1














            You can implement this like bellow



            If you want, You can use this annotation in controller argument to make sure your user is authenticated.



            @AuthenticationPrincipal User user
            .........
            .........


            Use this method like structure to check your password is matched or not. It return true value if it is matched.



            import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
            import org.springframework.security.crypto.password.PasswordEncoder;

            ..........
            ..........


            Your input password is "password" that you make to match with DB user find by



            User user = userService.findById(editUser.getId());

            public boolean userPasswordCheck(String password, User user) {

            PasswordEncoder passencoder = new BCryptPasswordEncoder();
            String encodedPassword = user.getPassword();
            return passencoder.matches(password, encodedPassword);
            }





            share|improve this answer




























              1














              You can implement this like bellow



              If you want, You can use this annotation in controller argument to make sure your user is authenticated.



              @AuthenticationPrincipal User user
              .........
              .........


              Use this method like structure to check your password is matched or not. It return true value if it is matched.



              import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
              import org.springframework.security.crypto.password.PasswordEncoder;

              ..........
              ..........


              Your input password is "password" that you make to match with DB user find by



              User user = userService.findById(editUser.getId());

              public boolean userPasswordCheck(String password, User user) {

              PasswordEncoder passencoder = new BCryptPasswordEncoder();
              String encodedPassword = user.getPassword();
              return passencoder.matches(password, encodedPassword);
              }





              share|improve this answer


























                1












                1








                1







                You can implement this like bellow



                If you want, You can use this annotation in controller argument to make sure your user is authenticated.



                @AuthenticationPrincipal User user
                .........
                .........


                Use this method like structure to check your password is matched or not. It return true value if it is matched.



                import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
                import org.springframework.security.crypto.password.PasswordEncoder;

                ..........
                ..........


                Your input password is "password" that you make to match with DB user find by



                User user = userService.findById(editUser.getId());

                public boolean userPasswordCheck(String password, User user) {

                PasswordEncoder passencoder = new BCryptPasswordEncoder();
                String encodedPassword = user.getPassword();
                return passencoder.matches(password, encodedPassword);
                }





                share|improve this answer













                You can implement this like bellow



                If you want, You can use this annotation in controller argument to make sure your user is authenticated.



                @AuthenticationPrincipal User user
                .........
                .........


                Use this method like structure to check your password is matched or not. It return true value if it is matched.



                import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
                import org.springframework.security.crypto.password.PasswordEncoder;

                ..........
                ..........


                Your input password is "password" that you make to match with DB user find by



                User user = userService.findById(editUser.getId());

                public boolean userPasswordCheck(String password, User user) {

                PasswordEncoder passencoder = new BCryptPasswordEncoder();
                String encodedPassword = user.getPassword();
                return passencoder.matches(password, encodedPassword);
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 30 at 4:13









                Subarata TalukderSubarata Talukder

                594513




                594513























                    0














                    You have to encode the local password before compare it with the db password.



                    The most easy method is to HASH the pass in MD5 in that way the HASH never change and you can compare the pass without error.



                    I hope it's what you asking for, let me know if you want more help. (Code or another).






                    share|improve this answer


























                    • I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                      – Mez Rbk
                      Nov 28 '18 at 10:24











                    • It's ok it solved

                      – Mez Rbk
                      Nov 28 '18 at 10:41
















                    0














                    You have to encode the local password before compare it with the db password.



                    The most easy method is to HASH the pass in MD5 in that way the HASH never change and you can compare the pass without error.



                    I hope it's what you asking for, let me know if you want more help. (Code or another).






                    share|improve this answer


























                    • I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                      – Mez Rbk
                      Nov 28 '18 at 10:24











                    • It's ok it solved

                      – Mez Rbk
                      Nov 28 '18 at 10:41














                    0












                    0








                    0







                    You have to encode the local password before compare it with the db password.



                    The most easy method is to HASH the pass in MD5 in that way the HASH never change and you can compare the pass without error.



                    I hope it's what you asking for, let me know if you want more help. (Code or another).






                    share|improve this answer















                    You have to encode the local password before compare it with the db password.



                    The most easy method is to HASH the pass in MD5 in that way the HASH never change and you can compare the pass without error.



                    I hope it's what you asking for, let me know if you want more help. (Code or another).







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 28 '18 at 10:39

























                    answered Nov 28 '18 at 10:20









                    MrproexMrproex

                    12




                    12













                    • I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                      – Mez Rbk
                      Nov 28 '18 at 10:24











                    • It's ok it solved

                      – Mez Rbk
                      Nov 28 '18 at 10:41



















                    • I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                      – Mez Rbk
                      Nov 28 '18 at 10:24











                    • It's ok it solved

                      – Mez Rbk
                      Nov 28 '18 at 10:41

















                    I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                    – Mez Rbk
                    Nov 28 '18 at 10:24





                    I already use the BCryptPasswordEncoder from Spring it's like MD5 it doesn't change, I use it for the login method but I don't know how to implement it on the password matching. If you have some code with the "PassEncoding.getInstance().passwordEncoder.encode" solution it will helpful thanks

                    – Mez Rbk
                    Nov 28 '18 at 10:24













                    It's ok it solved

                    – Mez Rbk
                    Nov 28 '18 at 10:41





                    It's ok it solved

                    – Mez Rbk
                    Nov 28 '18 at 10:41


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53516952%2fspring-boot-how-to-check-if-encoded-password-from-db-is-matching-with-password-f%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks