묻고 답해요
160만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
안녕하세요 강사님 낙관적 락 질문있습니다.
낙관적 락도 데드락이 터질 수 있다는 글을 많이 봤는데, 강의에서는 다루지 않아서 좀 헷갈립니다. 사람마다 코드가 다 다르기 때문에 데드락이 무조건 터진다 안 터진다를 말할 수 없을 거 같은데,어떤 상황일 때 데드락이 발생하는지에 대해 간단하게라도 설명해주실 수 있으신가요?항상 감사합니다.
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
validator 질문 드립니다
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. ItemValidator를 보면, target을 Item으로 캐스팅 하는데 오류가 없을까요? target으로 입력될 ItemSaveForm은 Item으로 형변환하기엔 없는 필드가 존재합니다.(Id) 강사님께선 어떻게 원할하게 돌아가는지 궁금하네요.
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
member 만 persist 했는데 ITEM 에도 데이터 삽입되는 이유
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 수업 듣던중 궁금한 것이 생겨 질문 남깁니다!member만 persist 했는데 ITEM 에도 데이터가 인서트 되는 것은 JPA가 상속관계임을 인지하고 알아서 값을 넣어주는 건가요??
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
http://localhost:8080/hello-mvc?name=spring!! 이 부분 에러가 발생합니다.
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.localhost:8080 까지는 잘나오고 다 잘 따라친거 같은데 뒤에 hello-mvc 부분부터는 에러가 발생하네요 ㅠㅠ
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part3: 유니티 엔진
git으로 협업할 때 conflict 발생
java 협업시 git을 써 보다가 유니티 작업을 git으로 협업을 하려고 하니 어려운 점이 있는데 도움 부탁드립니다. git으로 clone해서 작업하고 머지할 때 동일한 씬을 수정한 경우 컨플릭이 많이 발생합니다. 씬의 경우 컨플릭이 발생해도 사람이 작성한 코드가 아니다 보니 컨플릭을 해결하기가 어렵습니다. 씬 컨플릭이 발생하지 않게 git을 사용하는 방법이 있을까요?
-
해결됨대세는 쿠버네티스 (초급~중급편)
vagrant up 오류 문의
안녕하세요. 실습 환경 만들려고 계속 시도중인데요. 며칠 동안 해결이 안되고 있네요. -환경-윈도우10 virtualbox : 6.1.26vagrant : 2.2.18 https://kubetm.github.io/k8s/02-beginner/cluster-install-case6/이 링크 보면서 설치하고 있거든요. 몇 번을 지우고 재설치해도 성공을 못하고 있습니다.도움 부탁드립니다. \k8s>vagrant upBringing machine 'k8s-master' up with 'virtualbox' provider...Bringing machine 'k8s-node1' up with 'virtualbox' provider...Bringing machine 'k8s-node2' up with 'virtualbox' provider...==> k8s-master: Importing base box 'centos/7'...==> k8s-master: Matching MAC address for NAT networking...==> k8s-master: Checking if box 'centos/7' version '2004.01' is up to date...==> k8s-master: Setting the name of the VM: k8s_k8s-master_1697506308375_93844==> k8s-master: Clearing any previously set network interfaces...==> k8s-master: Preparing network interfaces based on configuration... k8s-master: Adapter 1: nat k8s-master: Adapter 2: hostonly==> k8s-master: Forwarding ports... k8s-master: 22 (guest) => 2222 (host) (adapter 1)==> k8s-master: Running 'pre-boot' VM customizations...==> k8s-master: Booting VM...==> k8s-master: Waiting for machine to boot. This may take a few minutes... k8s-master: SSH address: 127.0.0.1:2222 k8s-master: SSH username: vagrant k8s-master: SSH auth method: private key k8s-master: k8s-master: Vagrant insecure key detected. Vagrant will automatically replace k8s-master: this with a newly generated keypair for better security. k8s-master: k8s-master: Inserting generated public key within guest... k8s-master: Removing insecure key from the guest if it's present... k8s-master: Key inserted! Disconnecting and reconnecting using new SSH key...==> k8s-master: Machine booted and ready![k8s-master] No Virtualbox Guest Additions installation found.Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.cat.net * extras: ftp.riken.jp * updates: ftp.riken.jpResolving Dependencies--> Running transaction check---> Package centos-release.x86_64 0:7-8.2003.0.el7.centos will be updated---> Package centos-release.x86_64 0:7-9.2009.1.el7.centos will be an update--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package Arch Version Repository Size================================================================================Updating: centos-release x86_64 7-9.2009.1.el7.centos updates 27 kTransaction Summary================================================================================Upgrade 1 PackageTotal download size: 27 kDownloading packages:No Presto metadata available for updateswarning: /var/cache/yum/x86_64/7/updates/packages/centos-release-7-9.2009.1.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPublic key for centos-release-7-9.2009.1.el7.centos.x86_64.rpm is not installedRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7Importing GPG key 0xF4A80EB5: Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>" Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 Package : centos-release-7-8.2003.0.el7.centos.x86_64 (@anaconda) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7Running transaction checkRunning transaction testTransaction test succeededRunning transaction Updating : centos-release-7-9.2009.1.el7.centos.x86_64 1/2 Cleanup : centos-release-7-8.2003.0.el7.centos.x86_64 2/2 Verifying : centos-release-7-9.2009.1.el7.centos.x86_64 1/2 Verifying : centos-release-7-8.2003.0.el7.centos.x86_64 2/2Updated: centos-release.x86_64 0:7-9.2009.1.el7.centosComplete!Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.cat.net * extras: ftp.riken.jp * updates: ftp.riken.jphttp://vault.centos.org/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 301 - Moved PermanentlyTrying other mirror. One of the configured repositories failed (CentOS-7.0.1406 - Base), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=C7.0.1406-base ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable C7.0.1406-base or subscription-manager repos --disable=C7.0.1406-base 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=C7.0.1406-base.skip_if_unavailable=truefailure: repodata/repomd.xml from C7.0.1406-base: [Errno 256] No more mirrors to try.http://vault.centos.org/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 301 - Moved Permanently==> k8s-master: Checking for guest additions in VM... k8s-master: No guest additions were detected on the base box for this VM! Guest k8s-master: additions are required for forwarded ports, shared folders, host only k8s-master: networking, and more. If SSH fails on this machine, please install k8s-master: the guest additions and repackage the box to continue. k8s-master: k8s-master: This is not an error message; everything may continue to work properly, k8s-master: in which case you may ignore this message.The following SSH command responded with a non-zero exit status.Vagrant assumes that this means the command failed!yum install -y kernel-devel-`uname -r` --enablerepo=C*-base --enablerepo=C*-updatesStdout from the command:Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.cat.net * extras: ftp.riken.jp * updates: ftp.riken.jpStderr from the command:http://vault.centos.org/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 301 - Moved PermanentlyTrying other mirror. One of the configured repositories failed (CentOS-7.0.1406 - Base), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=C7.0.1406-base ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable C7.0.1406-base or subscription-manager repos --disable=C7.0.1406-base 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=C7.0.1406-base.skip_if_unavailable=truefailure: repodata/repomd.xml from C7.0.1406-base: [Errno 256] No more mirrors to try.http://vault.centos.org/7.0.1406/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 301 - Moved PermanentlyC:\Users\SungwookCho\k8s>
-
미해결Practical Testing: 실용적인 테스트 가이드
controller, service dto 분리에대해 질문드립니다.
포스, 키오스크, 이외 다른 주문 엔드포인트로부터 주문이 들어왔을때 똑같은 서비스를 사용할 경우 그 서비스에서 사용하는 서비스dto로 변환해주어야 하기 때문에 컨트롤러 dto와 서비스dto를 분리해주는게 좋다로 이해했는데 맞을까요?
-
미해결[실전 게임 코드 리뷰] 유니티 클리커 게임
RefreshUI(); 기능이 궁금합니다.
UI_ConfirmPopup.cs 파일에서 RefreshUI(); 함수 기능이 궁금합니다. using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using static Define; public class UI_ConfirmPopup : UI_Popup { enum Texts { MessageText } enum Buttons { YesButton, NoButton } string _text; public override bool Init() { //초기화를 안전하게 사용해도 되는지 확인하는 과정 //base.Init()이 true면 초기화 과정이 되어 있음. if (base.Init() == false) return false; BindText(typeof(Texts)); BindButton(typeof(Buttons)); GetButton((int)Buttons.YesButton).gameObject.BindEvent(OnClickYesButton); GetButton((int)Buttons.NoButton).gameObject.BindEvent(OnClickNoButton); GetText((int)Texts.MessageText).text = _text; RefreshUI(); return true; } Action _onClickYesButton; /// <summary> /// 람다식 실행을 위한 콜백함수 /// </summary> /// <param name="onClickYesButton"></param> /// <param name="text"></param> public void SetInfo(Action onClickYesButton, string text) { _onClickYesButton = onClickYesButton; _text = text; RefreshUI(); } void RefreshUI() { if (_init == false) return; } void OnClickYesButton() { Managers.UI.ClosePopupUI(this); Managers.Sound.Play(Sound.Effect, "Sound_CheckButton"); if (_onClickYesButton != null) _onClickYesButton.Invoke(); } void OnClickNoButton() { Managers.Sound.Play(Sound.Effect, "Sound_CancelButton"); OnComplete(); } void OnComplete() { Managers.UI.ClosePopupUI(this); } }
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
복습개념으로 다시 들을려고 하는데요
html,css,javascript를 복습 개념으로 다시 들을려고 하는데 훈훈한 Javascript 부터 들으면 되나요?
-
해결됨스프링 DB 2편 - 데이터 접근 활용 기술
EntityManager를 쓰는데, DB가 다르면 EntityManager도 2개 주입받아야 해요?
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]예를 들면 좀 회사의 기존 서비스에서 아예 새로운 서비스말고 기존의 서비스를 활용해서 뭔가 고객에게 제공해 주고 싶다, 하면 기존DB랑 새로 추가 해야 할 DB랑 다를 수 있잖아요.근데 EntityManager는 우리 눈에는 안보이지만, 자동으로 DataSource 주입 받잖아요.DataSource가 제가 기억하기로 말 그대로 데이터의 근원, h2 이런 것 들에 대한 연결할 수 있는 정보? 들을 얻어오는 걸로 기억을 해서, DB가 다르면 저것도 다를 수 있잖아요. 또 DB의 계정마다도 다를 것 같고.. 그러면 EntityManager가 2개 생기나요? 이번엔 같은 DB에 테이블만 다른거니 JPA 내부적으로 sql만 좀 다르게 짤거니까 상관 없어 보이지만..
-
미해결모두를 위한 대규모 언어 모델 LLM(Large Language Model) Part 1 - Llama 2 Fine-Tuning 해보기
학습 중 궁금한 부분 문의합니다
안녕하세요 라마2에 한국어 데이터셋만 학습해도 한국어 질문 답을 하는 것을 보고 궁금해서요 한국어 데이터 셋만 학습을 해도 라마2에서 한국어를 이해하고 대답하는 건지요 그리고 예제에서 질문을 한 후 받는 대답이 너무 짧게 나오는데요 이부분은 데이터셋의 답 부분이 짧아서 그런 가요 gpt는 엄청 길게 답을 하는데 이부분이 궁금하네요
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
에뮬레이터가 작동하지 않아요.
안녕하세요.오류도 안뜨고 성공 메세지가 뜨는데 에뮬레이터가 이 상태에서 앱 실행이 안되네요...ㅠ확인 부탁드려요ㅠ
-
해결됨유니티 2D RPG 게임 만들기
5강에서 6강 넘어갈 때 그 사이의 내용들은 어디 있는 건가요?
5강 Town 부분까지 다 수강하고 6강 들으려고 하는데6강 시작하시면서 저번 시간에 아이템, 인벤토리 기능들을 진행하셨다고 말씀하시는데그 부분 강의들이 없는 것 같습니다단순히 누락되어 있는 건지 아니면 이 부분은 그냥 넘어가고 마저 이어서 수강하면 되는 것인지 여쭤봅니다감사합니다
-
미해결스프링 시큐리티
파트4-5강의 실습중 manager로 로그인하고난후 /api/messages를 호출시 Authentication가 Anonymous토큰상태가 되어버립니다.
실습중 manager로 로그인해도 계속 401에러가발생하여/api/messages에 대해 permitAll권한을주어 테스트해보았는데 위에 스크린샷처럼 Anonymous토큰상태여서 발생하는듯한데 프로바이더에서 토큰처리는 완료한 상태입니다.로그인도 정상적으로 되고있구요. 뭔가 해야 할 작업이 빠진걸까요?스프링은 3.03버젼이고 스프링시큐리티도 6버전대입니다package io.security.corespringsecurity.security.config; import io.security.corespringsecurity.security.common.AjaxAccessDeniedHandler; import io.security.corespringsecurity.security.common.AjaxLoginAuthenticationEntryPoint; import io.security.corespringsecurity.security.filter.AjaxLoginProcessingFilter; import io.security.corespringsecurity.security.habdler.AjaxAuthenticationFailureHandler; import io.security.corespringsecurity.security.habdler.AjaxAuthenticationSuccessHandler; import io.security.corespringsecurity.security.provider.AjaxAuthenticationProvider; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.ProviderManager; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; @Configuration @Order(0) @RequiredArgsConstructor public class AjaxSecurityConfig { private final AuthenticationConfiguration authenticationConfiguration; @Bean public AjaxAuthenticationProvider ajaxAuthenticationProvider(){ return new AjaxAuthenticationProvider(); } @Bean public AuthenticationSuccessHandler ajaxAuthenticationSuccessHandler(){ return new AjaxAuthenticationSuccessHandler(); } @Bean public AuthenticationFailureHandler ajaxAuthenticationFailureHandler(){ return new AjaxAuthenticationFailureHandler(); } @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception{ http .authorizeHttpRequests(requests -> requests .requestMatchers("/api/**").permitAll() .requestMatchers(HttpMethod.GET,"/api/messages").hasRole("MANAGER") .anyRequest().authenticated()); http .exceptionHandling() .authenticationEntryPoint(new AjaxLoginAuthenticationEntryPoint()) .and() .addFilterBefore(ajaxLoginProcessingFilter(), UsernamePasswordAuthenticationFilter.class); http.csrf().disable(); return http.getOrBuild(); } @Bean public AccessDeniedHandler ajaxAccessDeniedHandler(){ return new AjaxAccessDeniedHandler(); } @Bean public AuthenticationManager authenticationManager() throws Exception{ ProviderManager providerManager = (ProviderManager)authenticationConfiguration.getAuthenticationManager(); providerManager.getProviders().add(ajaxAuthenticationProvider()); return providerManager; } @Bean public AjaxLoginProcessingFilter ajaxLoginProcessingFilter() throws Exception{ AjaxLoginProcessingFilter ajaxLoginProcessingFilter = new AjaxLoginProcessingFilter(); ajaxLoginProcessingFilter.setAuthenticationManager(authenticationManager()); ajaxLoginProcessingFilter.setAuthenticationSuccessHandler(ajaxAuthenticationSuccessHandler()); ajaxLoginProcessingFilter.setAuthenticationFailureHandler(ajaxAuthenticationFailureHandler()); return ajaxLoginProcessingFilter; } }package io.security.corespringsecurity.security.provider; import io.security.corespringsecurity.security.service.AccountContext; import io.security.corespringsecurity.security.token.AjaxAuthenticationToken; import io.security.corespringsecurity.util.PBKDF2Util; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; @Component public class AjaxAuthenticationProvider implements AuthenticationProvider{ @Autowired private UserDetailsService userDetailsService; @Transactional @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { String username = authentication.getName(); String password = (String)authentication.getCredentials(); AccountContext accountContext = (AccountContext)userDetailsService.loadUserByUsername(username); try { if(!PBKDF2Util.validatePassword(password, accountContext.getAccount().getPassword())){ throw new BadCredentialsException("BadCredentialsException"); } } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { throw new RuntimeException(e); } return new AjaxAuthenticationToken(accountContext.getAccount(), null, accountContext.getAuthorities()); } @Override public boolean supports(Class<?> authentication) { return authentication.equals(AjaxAuthenticationToken.class); } } package io.security.corespringsecurity.security.filter; import com.fasterxml.jackson.databind.ObjectMapper; import io.security.corespringsecurity.domain.AccountDto; import io.security.corespringsecurity.security.token.AjaxAuthenticationToken; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.thymeleaf.util.StringUtils; import java.io.IOException; public class AjaxLoginProcessingFilter extends AbstractAuthenticationProcessingFilter { private ObjectMapper objectMapper = new ObjectMapper(); public AjaxLoginProcessingFilter() { super(new AntPathRequestMatcher("/api/login")); } @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if(!jsAjax(request)){ throw new IllegalStateException("Authentication is not supported"); } AccountDto accountDto = objectMapper.readValue(request.getReader(), AccountDto.class); if(StringUtils.isEmpty(accountDto.getUsername()) || StringUtils.isEmpty(accountDto.getPassword())){ throw new IllegalArgumentException("Username or Password is empty"); } AjaxAuthenticationToken authenticationToken = new AjaxAuthenticationToken(accountDto.getUsername(), accountDto.getPassword()); return getAuthenticationManager().authenticate(authenticationToken); } private boolean jsAjax(HttpServletRequest request) { if("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))){ return true; } return false; } }
-
미해결스프링부트 시큐리티 & JWT 강의
Facebook 로그인 버튼만든 후 error(Sorry...) 발생시
인증 및 계정 만들기 > 수정 에서 Email 권한 추가해주어야 오류 안나네요.
-
해결됨[리뉴얼] 처음하는 파이썬 데이터 분석 (쉽게! 전처리, pandas, 시각화 전과정 익히기) [데이터분석/과학 Part1]
apply axis 관련 질문
섹션7-2 5분 2초 apply부분에 apply(func, axis = 0)으로 하면 왜 '영어' 행이 하나 더 생기나요?
-
미해결스프링 부트 개념과 활용
springSecurit jwt에 대해서 질문드립니다.
강좌 완강하고 난뒤에 리액트랑 연계프로젝트 만들면서 jwt작업하다가 궁금한게 있어서 질문드립니다. 1.리액트(localhost:3000) ,스프링부트 (localhost:8080) 의 Cors 설정입니다 @Configuration @EnableWebMvc public class WebConfig { private static final Long MAX_AGE = 3600L; private static final int CORS_FILTER_ORDER = -102; @Bean public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.addAllowedOrigin("http://localhost:3000"); config.setAllowedHeaders(Arrays.asList( HttpHeaders.AUTHORIZATION, HttpHeaders.CONTENT_TYPE, HttpHeaders.ACCEPT)); config.setAllowedMethods(Arrays.asList( HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.PUT.name(), HttpMethod.DELETE.name())); config.setMaxAge(MAX_AGE); source.registerCorsConfiguration("/**", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(CORS_FILTER_ORDER); return bean; } }Security 설정일부입니다 @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http .authorizeRequests(requests -> requests .requestMatchers("/login", "/signup", "/user").permitAll() .requestMatchers("http://localhost:8080/main") .hasAnyAuthority("ROLE_USER") ) .formLogin(login -> login .loginPage("/login") .usernameParameter("username") .loginProcessingUrl("/loginProcess") .successHandler((req, res, auth) -> { //여기선 토큰이 잘 나옵니다 데이터 String token = JwtUtil.generateToken(auth.getName()); res.addHeader("Authorization", "Bearer " + token); }) ) .logout(logout -> logout .logoutSuccessUrl("/login") .invalidateHttpSession(true) ) .csrf(csrf -> csrf.disable()) .build(); } 프론트쪽 react 입니다.axios .post(`${SERVER_URL}/loginProcess`, null, { params: loginData }) .then((response) => { //authorization,Authorization 바꿔봐도 둘다 안나옵니다. const token = response.headers["authorization"]; console.log("토큰:::::::::::::::::::::::::::::" + token); <==undefined가 나와요 localStorage.setItem("token", token); }) .catch((error) => console.log("Error:", error));문제점 : 서버에서 로그인은 정상적으로 되고 token생성까진 되는데 jwt의 토큰을 클라이언트인 리액트 쪽에서 받아오질 못하네요 이거 혹시 어디가 잘못된건지 알수있을까요 ?
-
미해결이득우의 언리얼 프로그래밍 Part3 - 네트웍 멀티플레이 프레임웍의 이해
Listen Server 실행 시 StandAlone 로그가 찍히지 않습니다.
현재 개발 환경은 Rider IDE에, UE 5.3.1 사용중입니다.32:00 쯤에 Play As Listen server + 뷰포트에서 실행 으로 실행 시 StandAlone으로 먼저 실행이 된다고 하셔서 그대로 따라했는데저는 Server로 된 로그만 나옵니다.5.3에서 변경 사항이 있는 것일까요? 아니면 제가 세팅을 잘못한 것인가요? 혹시 제가 잘못 따라쳤나 싶어서 제공해주신 브랜치에서 다운로드 후 실행 해보았는데도 같았습니다. 새로운 Client들을 계속 추가해도 GPlayInEditorID가 계속 0으로 들어오는데, 혹시 이것도 관련이 있을까요?
-
미해결게임 수학의 이해
질문이 있습니다.
안녕하세요 교수님Q1 높이를 표현하는 z가 0과 1로 고정이기 때문에 항상 평행하다 하셨는데 0과 1이라는 두개의 숫자가 있으니 0아니면 1로 계속 변할 수도 있는 것 아닌가요..??Q2 밀었을 때의 공간은 z=1, 미는양은 z=0 인 공간을 사용한다는 부분은 그렇지 않으면 원하는 결과가 나오지 않기 때문에 그렇다고 이해하면 맞는건가요?
-
해결됨[코드캠프] 시작은 프리캠프
복사붙여녛기가 끝인데
피그마 css에 나오는 부분을 복사붙여넣기 하면 끝인데 과제라는 의미가 있나요? 복붙만 하는 건데 도움이 되는 건가요?