# Nuxt 인증 (Vue.js / Nuxt.js) > 인증 전략, JWT, 세션 관리, OAuth, 미들웨어 보호, refresh token, CSRF - 20 면접 질문 - Senior - [면접 질문: Vue.js / Nuxt.js](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions.md) ## 1. Nuxt에서 JWT 인증과 세션 기반 인증의 주요 차이점은 무엇입니까? **답변** JWT는 인증 정보를 서명된 토큰에 담아 클라이언트 측에 저장하는 반면, 세션 기반 인증은 세션 식별자를 cookie에 담고 데이터를 서버 측에 저장합니다. JWT는 stateless하고 확장성이 좋지만 토큰에 데이터를 노출합니다. 반면 세션은 더 안전하지만 서버 측 저장소(Redis, 데이터베이스)가 필요합니다. ## 2. 인증된 사용자만 접근할 수 있도록 Nuxt 페이지를 보호하려면 어떻게 해야 하나요? **답변** definePageMeta를 auth middleware와 함께 사용하면 페이지를 보호할 수 있습니다. 이 middleware는 렌더링 전에 인증을 확인하고, 사용자가 인증되지 않은 경우 로그인 페이지로 리디렉션합니다. 이 방식은 SSR과 CSR 모두에서 작동하여 견고한 보호를 제공합니다. ## 3. Nuxt에서의 OAuth2 flow에서 인증 단계의 올바른 순서는 무엇인가요? **답변** OAuth2 Authorization Code flow는 다음 순서를 따릅니다. provider(Google, GitHub)로 리디렉션, 사용자 인증, authorization code가 포함된 callback, 서버 측에서 code를 access token으로 교환합니다. 이 안전한 순서는 민감한 token을 클라이언트에 노출하지 않도록 합니다. ## 17개 추가 질문 이용 가능 - JWT 인증 전략에서 access token에 더해 refresh token을 사용하는 이유는 무엇인가요? - CSRF 공격이란 무엇이며, session 기반 인증을 사용하는 Nuxt 애플리케이션에서 어떻게 방어하나요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Vue.js / Nuxt.js 면접 주제 - [JavaScript 기초](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/javascript-fundamentals.md): 20개 질문, Junior - [모던 JavaScript (ES6+)](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/es6-modern-javascript.md): 20개 질문, Junior - [Vue 기초](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-basics.md): 22개 질문, Junior - [Vue 컴포넌트](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-components.md): 20개 질문, Junior - [Vue Router](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-router.md): 18개 질문, Junior - [Pinia State Management](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/pinia-state-management.md): 20개 질문, Junior - [Vuex (Legacy)](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vuex-legacy.md): 15개 질문, Mid-Level - [Composition API](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/composition-api.md): 24개 질문, Mid-Level - [Vue 반응성](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-reactivity.md): 20개 질문, Mid-Level - [Nuxt 기초](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-fundamentals.md): 22개 질문, Mid-Level - [Nuxt 데이터 페칭](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-data-fetching.md): 20개 질문, Mid-Level - [Nuxt SSR 및 SSG](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-ssr-ssg.md): 22개 질문, Mid-Level - [Nuxt 서버 라우트](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-server-routes.md): 20개 질문, Mid-Level - [Nuxt 모듈](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-modules.md): 18개 질문, Mid-Level - [Vue 컴포저블](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-composables.md): 20개 질문, Mid-Level - [Vue 폼과 유효성 검사](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-forms-validation.md): 20개 질문, Mid-Level - [Nuxt 상태 관리](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-state-management.md): 18개 질문, Mid-Level - [Vue 테스팅](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-testing.md): 20개 질문, Mid-Level - [Nuxt 배포 및 CI/CD](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-deployment-cicd.md): 22개 질문, Mid-Level - [Vue 성능](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-performance.md): 22개 질문, Senior - [Vue 고급 패턴](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-advanced-patterns.md): 24개 질문, Senior - [Vue와 함께 사용하는 TypeScript](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/typescript-vue.md): 22개 질문, Senior - [Nuxt에서의 SEO](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-seo.md): 20개 질문, Senior - [Nuxt 국제화](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-i18n.md): 18개 질문, Senior - [Vue 아키텍처](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-architecture.md): 22개 질문, Senior - [Nuxt 보안](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-security.md): 20개 질문, Senior - [Vue 생태계](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/vue-ecosystem.md): 18개 질문, Senior - [Vue 2→3 및 Nuxt 2→3 마이그레이션](https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/migration-vue2-vue3-nuxt2-nuxt3.md): 22개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/vue-nuxt/interview-questions/nuxt-auth