Code Monkey home page Code Monkey logo

sample-spring-graphql's Introduction

👋👋 star 눌러주신 모든 분들께 감사합니다.

<Updated at 23.01.09>

header

Taewan's github stats

Career

Direct to Resume

  • (2019 ~ 2020) Effy Live Co. Ltd : Mobile Developer
  • (2020 ~ 2022) Pretzel Global Connection Group Co. Ltd : Chief Technology Officer
  • (2022 ~ 2023) Archi Co.(Freelancer Team) : Freelancer Developer
  • (2023 ~ 2025) Ruplic of Korea Airforce : Backend Developer

How to reach me

Tech Stacks

: Used in production level

Mobile Stacks

Web Stacks


Database Stacks

Server Stacks


DevOps Stacks

sample-spring-graphql's People

Contributors

terry960302 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sample-spring-graphql's Issues

BCryptPasswordEncoder encode 이슈

안녕하세요 spring, graphql, dgs 찾아보다가 오게되었습니다.

테스트해보던중 CredentialService.signIn 에 password 비교부분에 아래 블로그 내용과 동일한 문제가 있는거 같아요

passwordEncoder.matches(password, userCred.get().password) 비교하게 변경해보니 잘되는것 같습니다.

작성해주신 sapmle로 많이 도움이되었습니다. 재미있게 보고 갑니다 감사합니다.

참조 : https://cantcoding.tistory.com/69

원인
원인을 파악하기 위해 여러가지를 찍어보던중 해쉬로 encode되는 값이 매번 달라지는 것을 알아냈다.
System.out.println(result.getPassword());
System.out.println(bCryptPasswordEncoder.encode("12345"));
같아야 하는 값이 계속 다르게 출력되고 있었다. 그래서 BCrypt에 대해서 조사해봤다.
BCrypt는 해쉬에 솔트를 더하여 매번 다르게 값이 출력되게 만들어서 보안을 더 높인 암호화 방식이다.
따라서 솔트가 매번 다르기 때문에 encode된 값과 equals로 비교가 항상 다르기 때문에 테스트가 통과될 수 없는 구조였다. 해쉬를 하면 매번 같은 값이 나올것이라는 착각이였다.

해결방법
equals로 비교할 수 없는 BCryptPasswordEncoder은 비교 메서드 matches를 제공한다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.