{"id":38328,"date":"2024-11-01T17:17:37","date_gmt":"2024-11-01T17:17:37","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38328"},"modified":"2024-11-26T06:44:38","modified_gmt":"2024-11-26T06:44:38","slug":"express-%ea%b0%9c%eb%b0%9c-%ea%b0%95%ec%a2%8c-jwtjson-web-token-%ea%b8%b0%eb%b0%98-%ec%9d%b8%ec%a6%9d-%ea%b5%ac%ed%98%84","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38328\/","title":{"rendered":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604"},"content":{"rendered":"<p><body><\/p>\n<p>\uc624\ub298\ub0a0 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\uc790 \uc778\uc99d\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \ud2b9\ud788 RESTful API\ub97c \uc0ac\uc6a9\ud558\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc0c1\ud0dc\ub97c \uc720\uc9c0\ud558\uc9c0 \uc54a\ub294 \uc778\uc99d \ubc29\uc2dd\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc5d0\uc11c JWT(JSON Web Token)\ub294 \uc720\uc6a9\ud55c \ub3c4\uad6c\ub85c \ud65c\uc6a9\ub429\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 Node.js\uc758 Express \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uc774\uc6a9\ud558\uc5ec JWT \uae30\ubc18 \uc778\uc99d \uc2dc\uc2a4\ud15c\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 JWT\uc758 \uac1c\ub150, Express \uc11c\ubc84 \uc124\uc815, \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604, \ubcf4\ud638\ub41c \uacbd\ub85c \uc124\uc815 \ubc0f \ud074\ub77c\uc774\uc5b8\ud2b8 \uc694\uccad \ucc98\ub9ac \ub4f1\uc744 \ud3ec\ud568\ud558\uc5ec \uc885\ud569\uc801\uc778 \ub0b4\uc6a9\uc744 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<h2>1. JWT\ub780 \ubb34\uc5c7\uc778\uac00?<\/h2>\n<p>JWT\ub294 JSON Web Token\uc758 \uc57d\uc790\ub85c, \uc8fc\ub85c \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc815\ubcf4\ub97c \uc548\uc804\ud558\uac8c \uc804\uc1a1\ud558\uae30 \uc704\ud574 \uc0ac\uc6a9\ub418\ub294 \uac1c\ubc29\ud615 \ud45c\uc900\uc785\ub2c8\ub2e4. JWT\ub294 \uc138 \ubd80\ubd84\uc73c\ub85c \uad6c\uc131\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li><strong>Header<\/strong>: \ud1a0\ud070\uc758 \uba54\ud0c0\ub370\uc774\ud130\ub97c \ud3ec\ud568\ud558\uace0 \uc788\ub294 \ubd80\ubd84\uc785\ub2c8\ub2e4. \uc77c\ubc18\uc801\uc73c\ub85c \ud1a0\ud070\uc758 \ud0c0\uc785(JWT)\uacfc \uc0ac\uc6a9\ub41c \uc54c\uace0\ub9ac\uc998(\uc608: HMAC SHA256)\uc744 \uc9c0\uc815\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>Payload<\/strong>: \uc778\uc99d\uc5d0 \ud544\uc694\ud55c \uc815\ubcf4\ub97c \ub2f4\uace0 \uc788\ub294 \ubd80\ubd84\uc73c\ub85c, \uc0ac\uc6a9\uc790 ID\uc640 \uac19\uc740 \uc815\ubcf4\ub97c \ud3ec\ud568\ud569\ub2c8\ub2e4. \uc774 \ub370\uc774\ud130\ub294 JSON \ud615\uc2dd\uc73c\ub85c \uc778\ucf54\ub529\ub429\ub2c8\ub2e4.<\/li>\n<li><strong>Signature<\/strong>: Header\uc640 Payload\ub97c \uc870\ud569\ud558\uc5ec \uc11c\uba85\ud55c \ubd80\ubd84\uc785\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ub370\uc774\ud130\uac00 \ubcc0\uc870\ub418\uc9c0 \uc54a\uc558\uc74c\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h3>1.1 JWT\uc758 \uc7a5\uc810<\/h3>\n<p>JWT\ub294 \uc5ec\ub7ec \uac00\uc9c0 \uc7a5\uc810\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4:<\/p>\n<ul>\n<li>\uc0c1\ud0dc \ube44\uc800\uc7a5: \uc11c\ubc84\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uc758 \uc0c1\ud0dc\ub97c \uc800\uc7a5\ud560 \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\ubcf4\uc548\uc131: \uc11c\uba85 \uacfc\uc815\uc744 \ud1b5\ud574 \ub098\uc911\uc5d0 \ud1a0\ud070\uc774 \ubcc0\uc870\ub418\uc9c0 \uc54a\uc558\uc74c\uc744 \uc99d\uba85\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uc811\uadfc\uc131: JWT\ub294 JSON \ud615\uc2dd\uc73c\ub85c \ub418\uc5b4 \uc788\uc5b4 \ub2e4\uc591\ud55c \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\uc5d0\uc11c \uc27d\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>2. Express \uc11c\ubc84 \ud658\uacbd \uc124\uc815<\/h2>\n<p>Express.js\uc640 \uad00\ub828 \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud558\uace0 \uae30\ubcf8\uc801\uc778 \uc11c\ubc84\ub97c \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>2.1. Node.js \ubc0f Express \uc124\uce58<\/h3>\n<p>\uc6b0\uc120 Node.js\uac00 \uc124\uce58\ub418\uc5b4 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4. <a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noopener\">Node.js \uacf5\uc2dd \ud648\ud398\uc774\uc9c0<\/a> \uc5d0\uc11c \uc124\uce58\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Node\uc640 NPM\uc774 \uc124\uce58\ub41c \ud6c4, \ub2e4\uc74c \uba85\ub839\uc5b4\ub97c \ud1b5\ud574 Express\uc640 \ud544\uc694\ud55c \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>npm init -y\nnpm install express jsonwebtoken bcryptjs body-parser cors<\/code><\/pre>\n<h3>2.2. \uae30\ubcf8 \uc11c\ubc84 \uc124\uc815<\/h3>\n<p>\uba3c\uc800, \uae30\ubcf8 Express \uc11c\ubc84\ub97c \uc124\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. `server.js`\ub77c\ub294 \ud30c\uc77c\uc744 \ub9cc\ub4e4\uace0 \uc544\ub798\uc758 \ucf54\ub4dc\ub97c \uc785\ub825\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>const express = require('express');\nconst bodyParser = require('body-parser');\nconst cors = require('cors');\n\nconst app = express();\nconst PORT = process.env.PORT || 5000;\n\n\/\/ \ubbf8\ub4e4\uc6e8\uc5b4\napp.use(cors());\napp.use(bodyParser.json());\n\n\/\/ \uae30\ubcf8 \ub77c\uc6b0\ud2b8\napp.get('\/', (req, res) =&gt; {\n    res.send('Hello, Express with JWT!');\n});\n\n\/\/ \uc11c\ubc84 \uc2dc\uc791\napp.listen(PORT, () =&gt; {\n    console.log(`Server is running on port ${PORT}`);\n});<\/code><\/pre>\n<h2>3. \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604<\/h2>\n<p>\uc774\uc81c \uc0ac\uc6a9\uc790 \ub4f1\ub85d\uacfc \ub85c\uadf8\uc778\uc744 \uc704\ud55c API\ub97c \uad6c\ud604\ud558\uaca0\uc2b5\ub2c8\ub2e4. \uac04\ub2e8\ud55c \uc0ac\uc6a9\uc790 \uc800\uc7a5\uc18c\ub97c \uc704\ud574 \uba54\ubaa8\ub9ac\uc5d0 \uac04\ub2e8\ud55c \ubc30\uc5f4\uc744 \uc0ac\uc6a9\ud560 \uac83\uc785\ub2c8\ub2e4. \uc2e4\uc81c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>3.1. \uc0ac\uc6a9\uc790 \ub370\uc774\ud130 \ubaa8\ub378<\/h3>\n<p>\uc0ac\uc6a9\uc790 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\uae30 \uc704\ud574 \ub2e4\uc74c\uacfc \uac19\uc740 \uad6c\uc870\ub97c \uc0ac\uc6a9\ud560 \uac83\uc785\ub2c8\ub2e4:<\/p>\n<pre><code>let users = [];<\/code><\/pre>\n<h3>3.2. \ube44\ubc00\ubc88\ud638 \ud574\uc2dc\ud654<\/h3>\n<p>\uc0ac\uc6a9\uc790\uc758 \ube44\ubc00\ubc88\ud638\ub294 \uc800\uc7a5\ud558\uae30 \uc804\uc5d0 \uc548\uc804\ud558\uac8c \ud574\uc2dc\ud654\ud574\uc57c \ud569\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 `bcryptjs` \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uaca0\uc2b5\ub2c8\ub2e4. \uc544\ub798\ub294 \uc0ac\uc6a9\uc790 \ub4f1\ub85d API\uc785\ub2c8\ub2e4:<\/p>\n<pre><code>app.post('\/api\/register', async (req, res) =&gt; {\n    const { username, password } = req.body;\n\n    \/\/ \ube44\ubc00\ubc88\ud638 \ud574\uc2dc\ud654\n    const hashedPassword = await bcrypt.hash(password, 10);\n\n    \/\/ \uc0ac\uc6a9\uc790 \ub4f1\ub85d\n    const newUser = { username, password: hashedPassword };\n    users.push(newUser);\n\n    res.status(201).send('User registered successfully');\n});<\/code><\/pre>\n<h3>3.3. \ub85c\uadf8\uc778 API \uad6c\ud604<\/h3>\n<p>\ub85c\uadf8\uc778 API\ub294 \uc0ac\uc6a9\uc790\uac00 \uc81c\uacf5\ud55c \uc815\ubcf4\uc5d0 \ub530\ub77c JWT\ub97c \uc0dd\uc131\ud558\ub294 \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4:<\/p>\n<pre><code>app.post('\/api\/login', async (req, res) =&gt; {\n    const { username, password } = req.body;\n    const user = users.find(user =&gt; user.username === username);\n\n    if (!user) {\n        return res.status(400).send('Invalid credentials');\n    }\n\n    \/\/ \ube44\ubc00\ubc88\ud638 \ud655\uc778\n    const isPasswordValid = await bcrypt.compare(password, user.password);\n    if (!isPasswordValid) {\n        return res.status(400).send('Invalid credentials');\n    }\n\n    \/\/ JWT \uc0dd\uc131\n    const token = jwt.sign({ username: user.username }, 'secretKey', { expiresIn: '1h' });\n    res.json({ token });\n});<\/code><\/pre>\n<h2>4. \ubcf4\ud638\ub41c \uacbd\ub85c \uc124\uc815<\/h2>\n<p>JWT\ub97c \uc774\uc6a9\ud574 \uc778\uc99d\ub41c \uc0ac\uc6a9\uc790\ub9cc \uc811\uadfc \uac00\ub2a5\ud55c \ubcf4\ud638\ub41c \uacbd\ub85c\ub97c \uc124\uc815\ud558\uaca0\uc2b5\ub2c8\ub2e4. \uba3c\uc800 JWT\ub97c \uac80\uc99d\ud558\ub294 \ubbf8\ub4e4\uc6e8\uc5b4\ub97c \uc791\uc131\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>function authenticateToken(req, res, next) {\n    const token = req.headers['authorization'] &amp;&amp; req.headers['authorization'].split(' ')[1];\n\n    if (!token) return res.sendStatus(401);\n\n    jwt.verify(token, 'secretKey', (err, user) =&gt; {\n        if (err) return res.sendStatus(403);\n        req.user = user;\n        next();\n    });\n}<\/code><\/pre>\n<h3>4.1 \ubcf4\ud638\ub41c API \uc608\uc81c<\/h3>\n<p>\uc778\uc99d\ub41c \uc0ac\uc6a9\uc790\ub9cc \uc811\uadfc\ud560 \uc218 \uc788\ub294 \ubcf4\ud638\ub41c API\ub97c \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>app.get('\/api\/protected', authenticateToken, (req, res) =&gt; {\n    res.send(`Hello, ${req.user.username}! This is a protected route.`);\n});<\/code><\/pre>\n<h2>5. \ud074\ub77c\uc774\uc5b8\ud2b8 \uc694\uccad \ucc98\ub9ac<\/h2>\n<p>\uc774\uc81c \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uc11c \uc704\uc758 API\ub97c \ud638\ucd9c\ud558\uc5ec \ud14c\uc2a4\ud2b8\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, `fetch`\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 \uc694\uccad\uc744 \ubcf4\ub0bc \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>async function register(username, password) {\n    const response = await fetch('http:\/\/localhost:5000\/api\/register', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/json' },\n        body: JSON.stringify({ username, password }),\n    });\n    return response.text();\n}\n\nasync function login(username, password) {\n    const response = await fetch('http:\/\/localhost:5000\/api\/login', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/json' },\n        body: JSON.stringify({ username, password }),\n    });\n    const { token } = await response.json();\n    localStorage.setItem('token', token);\n    return token;\n}\n\nasync function accessProtected() {\n    const token = localStorage.getItem('token');\n    const response = await fetch('http:\/\/localhost:5000\/api\/protected', {\n        headers: { 'Authorization': `Bearer ${token}` },\n    });\n    return response.text();\n}<\/code><\/pre>\n<h2>6. \uacb0\ub860<\/h2>\n<p>\uc774\uc81c \uac04\ub2e8\ud55c Express \uc11c\ubc84\uc5d0\uc11c JWT \uae30\ubc18 \uc778\uc99d\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc744 \ud1b5\ud574 JWT\uc758 \uac1c\ub150, \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604, \ubcf4\ud638\ub41c \uacbd\ub85c \uc124\uc815 \ubc0f \ud074\ub77c\uc774\uc5b8\ud2b8 \uc694\uccad \ucc98\ub9ac \ub4f1\uc744 \uc775\ud614\uc2b5\ub2c8\ub2e4. \uc2e4\uc81c \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ub354 \ub9ce\uc740 \uae30\ub2a5\uc744 \ucd94\uac00\ud558\uc5ec \ubc1c\uc804\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4. JWT\ub97c \uc0ac\uc6a9\ud558\uba74 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \ubcf4\uc548\uc131\uc744 \ub192\uc774\uace0, \ud655\uc7a5\uc131\uc744 \ud655\ubcf4\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub354 \ub098\uc544\uac00 OAuth\uc640 \uac19\uc740 \uc778\uc99d \uccb4\uacc4\uc640 \uc5f0\uacc4\ud558\uc5ec \ub354\uc6b1 \ubc1c\uc804\ub41c \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>7. \ucc38\uace0 \uc790\ub8cc<\/h2>\n<ul>\n<li><a href=\"https:\/\/jwt.io\/\" target=\"_blank\" rel=\"noopener\">JWT \uacf5\uc2dd \uc0ac\uc774\ud2b8<\/a><\/li>\n<li><a href=\"https:\/\/expressjs.com\/\" target=\"_blank\" rel=\"noopener\">Express.js \uacf5\uc2dd \ubb38\uc11c<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/bcryptjs\" target=\"_blank\" rel=\"noopener\">bcrypt.js \ubb38\uc11c<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Promise\" target=\"_blank\" rel=\"noopener\">JavaScript Promises<\/a><\/li>\n<\/ul>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc624\ub298\ub0a0 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\uc790 \uc778\uc99d\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \ud2b9\ud788 RESTful API\ub97c \uc0ac\uc6a9\ud558\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc0c1\ud0dc\ub97c \uc720\uc9c0\ud558\uc9c0 \uc54a\ub294 \uc778\uc99d \ubc29\uc2dd\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc5d0\uc11c JWT(JSON Web Token)\ub294 \uc720\uc6a9\ud55c \ub3c4\uad6c\ub85c \ud65c\uc6a9\ub429\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 Node.js\uc758 Express \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uc774\uc6a9\ud558\uc5ec JWT \uae30\ubc18 \uc778\uc99d \uc2dc\uc2a4\ud15c\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 JWT\uc758 \uac1c\ub150, Express \uc11c\ubc84 \uc124\uc815, \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604, &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38328\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[181],"tags":[],"class_list":["post-38328","post","type-post","status-publish","format-standard","hentry","category-express"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38328\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\uc624\ub298\ub0a0 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\uc790 \uc778\uc99d\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \ud2b9\ud788 RESTful API\ub97c \uc0ac\uc6a9\ud558\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc0c1\ud0dc\ub97c \uc720\uc9c0\ud558\uc9c0 \uc54a\ub294 \uc778\uc99d \ubc29\uc2dd\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc5d0\uc11c JWT(JSON Web Token)\ub294 \uc720\uc6a9\ud55c \ub3c4\uad6c\ub85c \ud65c\uc6a9\ub429\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 Node.js\uc758 Express \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uc774\uc6a9\ud558\uc5ec JWT \uae30\ubc18 \uc778\uc99d \uc2dc\uc2a4\ud15c\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 JWT\uc758 \uac1c\ub150, Express \uc11c\ubc84 \uc124\uc815, \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604, &hellip; \ub354 \ubcf4\uae30 &quot;Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38328\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T17:17:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:38+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604\",\"datePublished\":\"2024-11-01T17:17:37+00:00\",\"dateModified\":\"2024-11-26T06:44:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/\"},\"wordCount\":80,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Express\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38328\/\",\"name\":\"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T17:17:37+00:00\",\"dateModified\":\"2024-11-26T06:44:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38328\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38328\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38328\/","og_locale":"ko_KR","og_type":"article","og_title":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\uc624\ub298\ub0a0 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\uc790 \uc778\uc99d\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \ud2b9\ud788 RESTful API\ub97c \uc0ac\uc6a9\ud558\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc0c1\ud0dc\ub97c \uc720\uc9c0\ud558\uc9c0 \uc54a\ub294 \uc778\uc99d \ubc29\uc2dd\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc5d0\uc11c JWT(JSON Web Token)\ub294 \uc720\uc6a9\ud55c \ub3c4\uad6c\ub85c \ud65c\uc6a9\ub429\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 Node.js\uc758 Express \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uc774\uc6a9\ud558\uc5ec JWT \uae30\ubc18 \uc778\uc99d \uc2dc\uc2a4\ud15c\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 JWT\uc758 \uac1c\ub150, Express \uc11c\ubc84 \uc124\uc815, \uc0ac\uc6a9\uc790 \ub4f1\ub85d \ubc0f \ub85c\uadf8\uc778 API \uad6c\ud604, &hellip; \ub354 \ubcf4\uae30 \"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604\"","og_url":"https:\/\/atmokpo.com\/w\/38328\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T17:17:37+00:00","article_modified_time":"2024-11-26T06:44:38+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38328\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38328\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604","datePublished":"2024-11-01T17:17:37+00:00","dateModified":"2024-11-26T06:44:38+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38328\/"},"wordCount":80,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Express\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38328\/","url":"https:\/\/atmokpo.com\/w\/38328\/","name":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T17:17:37+00:00","dateModified":"2024-11-26T06:44:38+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38328\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38328\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38328\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Express \uac1c\ubc1c \uac15\uc88c, JWT(JSON Web Token) \uae30\ubc18 \uc778\uc99d \uad6c\ud604"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38328"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38328\/revisions"}],"predecessor-version":[{"id":38329,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38328\/revisions\/38329"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}