묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
실전 문제 풀이 해설 파일 문의
안녕하세요.덕분에 강의 잘 듣고 있습니다. 다름이 아니라 실전문제 pdf외로 각 보기 별 해설이 작성된 파일도 내려받을 수 있을까요?실전문제풀이 강의를 보면 각 보기 별로 틀린 이유에 대해서 작성해 주시는데요. 이 부분도 반영된 파일을 받을 수 있는 지 문의 드립니다. 감사합니다.
-
미해결스프링 부트 - 핵심 원리와 활용
강의 PPT 자료 관련 문의
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]안녕하세요! 강의 잘 듣고 있습니다.다름이 아니라 올려주신 수업 자료에는 '스프링 부트 소개' 파트에서 사용하신 PPT 자료가 업로드 되어 있지 않습니다.복습을 위해 해당 자료가 있으면 좋을듯 한데, 추후 따로 업로드 해주실 수 있는지 궁금합니다.감사합니다!
-
미해결
아나콘다 커널연결시 에러
pip로 ipykernel 설치했고,커널 연결하려고 하니까 이런 에러가 뜨고 있습니다 커널 list 에도 "yuseong" 이 아예 뜨지 않는데뭐가 문제일까요?
-
해결됨스프링 시큐리티 OAuth2
Ajax 인증시 인가코드가 발급 되지 않는 원인 문의
Spring Authorization 1.0,1 기반으로 개발을 하고 있습니다. 인가코드를 발급 할떄 FormLogin 기본 설정을 사용하면 인가코드가 발급이 되는데 Ajax 로 로그인을 하면 인가코드가 발급되지 않고 있습니다. 디버깅을 해보면 로그인인 후 OAuth2AuthorizationEndpointFilter 는 실행되는데 @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if (!this.authorizationEndpointMatcher.matches(request)) { filterChain.doFilter(request, response); return; } try { Authentication authentication = this.authenticationConverter.convert(request); if (authentication instanceof AbstractAuthenticationToken) { ((AbstractAuthenticationToken) authentication) .setDetails(this.authenticationDetailsSource.buildDetails(request)); } Authentication authenticationResult = this.authenticationManager.authenticate(authentication); if (!authenticationResult.isAuthenticated()) { // If the Principal (Resource Owner) is not authenticated then // pass through the chain with the expectation that the authentication process // will commence via AuthenticationEntryPoint filterChain.doFilter(request, response); return; } if (authenticationResult instanceof OAuth2AuthorizationConsentAuthenticationToken) { if (this.logger.isTraceEnabled()) { this.logger.trace("Authorization consent is required"); } sendAuthorizationConsent(request, response, (OAuth2AuthorizationCodeRequestAuthenticationToken) authentication, (OAuth2AuthorizationConsentAuthenticationToken) authenticationResult); return; } this.authenticationSuccessHandler.onAuthenticationSuccess( request, response, authenticationResult); } catch (OAuth2AuthenticationException ex) { if (this.logger.isTraceEnabled()) { this.logger.trace(LogMessage.format("Authorization request failed: %s", ex.getError()), ex); } this.authenticationFailureHandler.onAuthenticationFailure(request, response, ex); } } FormLogin 적용시에는 authenticationResult의 principal 에 UsernamePasswordAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되는데 AjaxLogin 적용시에는 authenticationResult의 principal 에 AnonymousAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되지 않고 403 예외가 발생합니다.AuthenticationProvider 구현체에서는 정상적으로 토큰을 저장하고 있습니다. AuthenticationProvider 구현체 소스@Component @RequiredArgsConstructor public class CustomAuthenticationProvider implements AuthenticationProvider { private final CustomUserDetailsService customUserDetailsService; private final PasswordEncoder passwordEncoder; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(authentication == null){ throw new InternalAuthenticationServiceException("Authentication is null"); } LoginRequestDto loginRequestDto = (LoginRequestDto)authentication.getPrincipal(); String password = loginRequestDto.getLoginPassword(); UserAdapter userAdapter = (UserAdapter) customUserDetailsService.loadUserByLoinRequestDto(loginRequestDto); if (!passwordEncoder.matches(password, userAdapter.getCurrentUser().getLoginPwd())) { throw new BadCredentialsException("BadCredentialsException"); } CustomAuthenticationToken result = CustomAuthenticationToken.authenticated(userAdapter.getCurrentUser(), authentication.getCredentials(), userAdapter.getAuthorities()); result.setDetails(authentication.getDetails()); return result; } @Override public boolean supports(Class<?> authentication) { return CustomAuthenticationToken.class.isAssignableFrom(authentication); } } 이외 Custom 소스Spring Security 설정@EnableWebSecurity @RequiredArgsConstructor @Configuration public class DefaultSecurityConfig { private final CustomAuthenticationProvider customAuthenticationProvider; // private final CustomUserDetailsService customUserDetailsService; @Bean public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception { return authenticationConfiguration.getAuthenticationManager(); } @Bean public CustomAuthenticationProcessingFilter customAuthenticationProcessingFilter() throws Exception { CustomAuthenticationProcessingFilter filter = new CustomAuthenticationProcessingFilter(); // filter.setAuthenticationManager(authenticationManager(null)); filter.setAuthenticationManager(new ProviderManager(customAuthenticationProvider)); // filter.setAuthenticationSuccessHandler(customAuthenticationSuccessHandler()); // filter.setAuthenticationFailureHandler(customAuthenticationFailureHandler()); return filter; } // @formatter:off @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorizeRequests ->authorizeRequests .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers(new AntPathRequestMatcher("/")).permitAll() .requestMatchers(new AntPathRequestMatcher("/login/**")).permitAll() .requestMatchers("/api/login/**").permitAll() .requestMatchers("/api/registered-client/**").permitAll() .anyRequest().authenticated() ); http.addFilterBefore(customAuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class); http.exceptionHandling(httpSecurityExceptionHandlingConfigurer -> httpSecurityExceptionHandlingConfigurer .authenticationEntryPoint(new CustomLoginAuthenticationEntryPoint()) .accessDeniedHandler(customAccessDeniedHandler()) ); // http.userDetailsService(customUserDetailsService); // http.formLogin(); http.csrf().disable(); return http.build(); } // @formatter:on @Bean public AccessDeniedHandler customAccessDeniedHandler() { return new CustomAccessDeniedHandler(); } @Bean public AuthenticationSuccessHandler customAuthenticationSuccessHandler() { return new CustomAuthenticationSuccessHandler(); } @Bean public AuthenticationFailureHandler customAuthenticationFailureHandler() { return new CustomAuthenticationFailureHandler(); } } Ajax 로그인 처리 필터 소스public class CustomAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter { private final ObjectMapper objectMapper = new ObjectMapper(); private static final AntPathRequestMatcher DEFAULT_ANT_PATH_REQUEST_MATCHER = new AntPathRequestMatcher("/api/login", HttpMethod.POST.name()); public CustomAuthenticationProcessingFilter() { super(DEFAULT_ANT_PATH_REQUEST_MATCHER); } public CustomAuthenticationProcessingFilter(AuthenticationManager authenticationManager) { super(DEFAULT_ANT_PATH_REQUEST_MATCHER, authenticationManager); } @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!request.getMethod().equals("POST")) { throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); } LoginRequestDto loginRequestDto = objectMapper.readValue(request.getReader(), LoginRequestDto.class); if(StringUtils.isEmpty(loginRequestDto.getLoginId())||StringUtils.isEmpty(loginRequestDto.getLoginPassword())) { throw new IllegalStateException("Username or Password is empty"); } CustomAuthenticationToken authRequest = CustomAuthenticationToken.unauthenticated(loginRequestDto, loginRequestDto.getLoginPassword()); authRequest.setDetails(this.authenticationDetailsSource.buildDetails(request)); return getAuthenticationManager().authenticate(authRequest); } } CustomAuthenticationToken 소스public class CustomAuthenticationToken extends AbstractAuthenticationToken { private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID; private final Object principal; private Object credentials; public CustomAuthenticationToken(Object principal, Object credentials) { super(null); this.principal = principal; this.credentials = credentials; setAuthenticated(false); } public CustomAuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.principal = principal; this.credentials = credentials; super.setAuthenticated(true); // must use super, as we override } public static CustomAuthenticationToken unauthenticated(Object principal, Object credentials) { return new CustomAuthenticationToken(principal, credentials); } public static CustomAuthenticationToken authenticated(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { return new CustomAuthenticationToken(principal, credentials, authorities); } @Override public Object getCredentials() { return this.credentials; } @Override public Object getPrincipal() { return this.principal; } }
-
해결됨it 취업을 위한 알고리즘 문제풀이 입문 (with C/C++) : 코딩테스트 대비
테스트 케이스 질문
#include <iostream> #include <vector> using namespace std; int main() { freopen("input.txt", "rt", stdin); int s, n, i, j, tmp, idx; scanf("%d%d", &s, &n); vector<int> a(n); for (i = 0; i < n; i++) { scanf("%d", &tmp); if(i < s) a[s-1-i] = tmp; else { idx = s; for (j = 0; j < s; j++) { if(a[j] == tmp) { idx = j; break; } } for (j = idx - 1; j >= 0; j--) a[j+1] = a[j]; a[j+1] = tmp; } } for (i = 0; i < s; i++) printf("%d ", a[i]); return 0; }이렇게 작성했는데 채점 폴더 전부 통과하는데 만약 입력이 5 51 2 2 3 4 이 들어왔다면 출력이4 3 2 2 1로 출력 되니까 위의 코드는 틀린 코드 같은데 맞나요???
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
numpy.random.default_rng/hyperopt버젼
안녕하세요, 권철민 강사님!강의 잘 듣고있습니다~1.4.9_ 분류실습_산탄데르_고객만족예측 실습 중에numpy.random.default_rng()를 사용하셨는데 default_rng() 를 사용하신 이유가 있으실까요? 이건 어떤때 쓰는게 좋은건가요? 2.저는 코랩을 쓰고 있는데, hyperopt는 실행이 안됩니다. 이전에 답변을 보니 넘파이와 hyperopt의 버젼 문제일거라고 하셨는데, 코랩에서 버젼을 바꾸어야 할까요? 현재 버젼은 다음과 같습니다.hyperopt(0.2), np(1.22.4)감사합니다!
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
한줄 if 쓸 때 return의 필요성
한줄로 if문을 쓰실 때 return을 붙이시는 이유가 있나요??제가 감히 생각해보면 return을 붙일 필요가 없는 것 같은데코드를 좀 더 명확하게 하시려고 붙이시는 건가요??
-
해결됨스프링 프레임워크는 내 손에 [스프1탄]
23.Spring MVC02 버전 만들기(Ajax, jQuery)
SPringMVC01 폴더를 복사 후, SpringMVC02 폴더로 변경해서 강의 순서대로 실행을 했는데, Mapping 경로를 찾지 못하는 오류가 발생했습니다. 그래서 해결 방법으로 [appServlet] - [servlet-context.xml] 파일 안에 19번째 줄 기존의 파일 내용 일부분을 수정했습니다. 이렇게 해도 괜찮을까요 ? 다른 방법이 있으면 알고 싶어요 ㅠ[servlet-context.xml] - 수정 전 <resources mapping="/resources/**" location="/resources/" /> [servlet-context.xml] - 수정 <resources mapping="/assets/**" location="/resources/assets/" /> <resources mapping="/ad_assets/**" location="/resources/ad_assets/" /> a
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
시간 오류 - getTime()
안녕하세요. 한국에선 문제 없던 앱이. 미국에서 동작할경우 등록한 날짜보다 하루 전의 날짜로 저장되는문제를 겪었습니다.찾아보니 getTime()도 toISOString 와 마찬가지로 UTC 0+ 시간으로 작동되는 부분이 문제였습니다. 스토리지에 저장되는 타임스탬프가 UTC 기반이였던거죠. 달력에서 날짜를 설정할때 시간은 반영되지않고 12am 즉 00시로 설정되는데, 한국은 UTC +9 이라 날짜에 영향을 주지 않았지만, 제가 있는 지역의 타임존은 UTC -5이기에 하루전날의 타임스탬프가 저장되고 다시 그 타임스탬을 이용해 new Date(date)을 해줄때 전날의 날짜가 불러진다고 결론내렸습니다.이문제를 해결하기위해, 스트로지에 타임스탬프가아닌 getStringDate 으로 뽑아낸 스트링 날짜를 넣어주었고. 다이어리 리스트에서 sort 를 위한 비교를할때만 getTime()을 써주었습니다. 전문가의 의견을 듣고싶습니다.
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
github 권한 요청 드립니다
인프런 아이디 : devdh.cho@samsung.com인프런 이메일 : devdh.cho@samsung.com깃헙 아이디 : rhsnfl1122깃헙 Username : JoDongHyuen
-
해결됨외워서 끝내는 네트워크 핵심이론 - 기초
TCP 연결 종료 과정 중 Time wait관련
서버로부터 FIN + ACK을 수신 후, 최종 ACK를 서버로 다시 전달한 다음, TIME_WAIT 상태로 넘어가고, 일정 시간이 지난 다음 Close 처리가 된다는 설명에서,TIME_WAIT 시간은 정해진 값이 있는 것인지? 아니면 소켓 프로그래밍 시 따로 정해주는 것인지?바로 CLOSED하지 않고, TIME_WAIT을 하는 이유(목적)는 무엇인지?질문의 드립니다. :) 널널한개발자님 답변 부탁 드립니다!!
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
atom으로 강의를 하는데...
vscode 로 셋팅을 다 하도록 영상이 나왔는데 print문 강의는 아톰으로 시작하네요? vscode로 해도 괜찮나요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
강사님의 강의노트
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.강사님의 강의노트를 사이트에서 계속 찾아봤는데 찾을수가 없네요. 강의노트(소스와 개념설명)를 다운받을 수 있는 방법을 부탁드립니다.
-
해결됨GraphQL 완전정복 (키오스크를 만들며 배우는 풀스택 과정) - [2024 부분 리뉴얼]
apollo-upload-client 패키지 설치에러 문구
해당 부분 진행중에위와 같은 에러 코드를 보게 되었습니다.설치는 잘 된 것 같은데, 문제가 없을까 염려됩니다.
-
해결됨GraphQL 완전정복 (키오스크를 만들며 배우는 풀스택 과정) - [2024 부분 리뉴얼]
meteor npm i short 설치 에러문구
이 부분을 진행하고 있었습니다.라고 에러가 나오는데, 문제가 없을까요?혹시 몰라서, 지우고, 이 방법으로 설치해봤습니다. 이렇게 하니까, 에러문구는 많이 안보이네요
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
이 강의를 들을 때 필요한 언어공부가 있을까요? 추천 부탁드립니다,
제가 백엔드 공부도 처음이고 언어 공부에서도 c 이후로 는 거의 하지 않았습니다. 프로젝트 단계로 넘어가기 전 언어 공부를 해야 더 도움이 될거같은데 typescript 나 자바스크립트를 선행 언어 공부를 한 후에 들어야 도움이 더 잘 될까요? 아니면 공부 없이도 듣기 괜찮을 까요?
-
해결됨독하게 되새기는 C 프로그래밍
스택 메모리는 왜 아껴야 하는건가요?
기본적으로 힙과 스택이 어떤 식으로 사용되는지는 알고 있는데요,다만 스택의 기본 최대 크기가 1MB라는 점이 잘 이해가 안됩니다..아마 제가 실무를 경험해본 적이 없어서 공감을 못하는 듯한데이 1MB라는 것이 기본값으로 쓰일 만큼 적절한 크기인가요?제 생각엔 그렇게 널널한 크기는 아닌 듯한데.. 그렇게까지 아껴야 하는 이유가 뭘까 싶어서 질문드립니다그냥 힙 영역을 최대한 많이 확보하기 위해서라고 생각하면 될까요?
-
해결됨스프링 부트 - 핵심 원리와 활용
수업자료 내의 프로젝트 src파일이 안보입니다.
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]안녕하세요.강의 수강중 소스 파일 내에 server-start, memory-v1-start 프로젝트에는 src 폴더가 포함되어있지 않습니다.다른 프로젝트나 complete 내의 프로젝트에는 src 폴더가 있어서 확인해주실수 있을까요?
-
해결됨GraphQL 완전정복 (키오스크를 만들며 배우는 풀스택 과정) - [2024 부분 리뉴얼]
apollo-cache 조작 방법 / update Item 부분
안녕하세요. 강의 잘 따라가고 있습니다!강의를 보면, updateItem 을 cache 조작을 이용해서, 수정되도록하는 것을 보여주시는데요.cache.wirteQuery(), 와 cache.Modify() 사용법두가지 방법을 보여주시는데,코드상, 기존에 $itemFormValue 스토어를 통해, 이미 수정, 삭제기능이 잘 작동하도록 구현되어있는 상태에서,수업을 통해, 캐시 조작 부분의 코드가 더해지고 있는데요.그래서, 수업에서 잘 되는 것을 시연해주시는데,캐시부분 코드가 없어도, 잘 작동하기 때문에,수업에서 더해진 코드 덕분에, 기존 코드에서는 어떤기능을 빼도되는건지, 모르겠습니다.아니면, 어떤 기능이 더 개선되었는지 차이가 궁금합니다.
-
미해결앨런 iOS Concurrency(동시성) - 디스패치큐와 오퍼레이션큐의 이해
비동기 개념에서 무엇을 return하는 거죠??
비동기 개념에서 즉시 리턴 한다고 하셨는데 무엇을 리턴하는지 궁금합니다!