jose vs jwa vs jsonwebtoken vs passport-jwt vs express-jwt
웹 개발에서의 JWT 라이브러리
josejwajsonwebtokenpassport-jwtexpress-jwt유사 패키지:

웹 개발에서의 JWT 라이브러리

JWT(제이슨 웹 토큰)는 클라이언트와 서버 간의 인증 및 권한 부여를 위한 안전한 방법입니다. 이 라이브러리들은 JWT를 생성하고 검증하는 데 사용되며, 각 라이브러리는 특정한 기능과 사용 사례에 맞춰 설계되었습니다. 이들 라이브러리를 통해 개발자는 사용자 인증을 보다 쉽게 구현할 수 있습니다.

npm 다운로드 트렌드

3 년

GitHub Stars 순위

통계 세부사항

패키지
다운로드
Stars
크기
Issues
발행일
라이선스
jose239,787,0177,888222 kB05時間前MIT
jwa126,760,85710314.1 kB182年前MIT
jsonwebtoken83,388,91918,18543.4 kB2171年前MIT
passport-jwt5,605,7941,98052 kB42-MIT
express-jwt1,106,8534,51128.5 kB642年前MIT

기능 비교: jose vs jwa vs jsonwebtoken vs passport-jwt vs express-jwt

사용 용이성

  • jose:

    다양한 형식과 알고리즘을 지원하지만, 상대적으로 복잡한 API를 가지고 있어 사용하기 위해서는 더 많은 학습이 필요합니다.

  • jwa:

    다양한 알고리즘을 지원하지만, 사용자가 알고리즘을 선택하고 설정해야 하므로 다소 복잡할 수 있습니다.

  • jsonwebtoken:

    간단한 API와 명확한 문서화 덕분에 사용하기 쉽고, 기본적인 JWT 생성 및 검증 기능을 제공합니다.

  • passport-jwt:

    Passport.js의 인증 전략을 활용하여 사용하기 쉽고, 다른 Passport 전략과의 통합이 용이합니다.

  • express-jwt:

    Express.js와의 통합이 용이하여, 미들웨어로 쉽게 설정할 수 있습니다. JWT 검증을 위한 간단한 API를 제공하여 빠르게 사용할 수 있습니다.

보안 기능

  • jose:

    JWK 및 다양한 암호화 알고리즘을 지원하여 높은 수준의 보안을 제공합니다. 다양한 보안 요구 사항을 충족할 수 있습니다.

  • jwa:

    다양한 암호화 알고리즘을 지원하여 보안성을 높일 수 있으며, 알고리즘에 대한 세부적인 제어가 가능합니다.

  • jsonwebtoken:

    기본적인 서명 및 검증 기능을 제공하지만, 보안 요구 사항이 복잡한 경우에는 추가적인 설정이 필요할 수 있습니다.

  • passport-jwt:

    JWT를 사용한 인증을 제공하며, Passport.js의 다른 전략과 결합하여 보안성을 높일 수 있습니다.

  • express-jwt:

    JWT 검증을 통해 요청의 유효성을 검사하며, 비밀 키를 사용하여 안전한 인증을 제공합니다.

확장성

  • jose:

    다양한 형식과 알고리즘을 지원하여 복잡한 요구 사항에 맞게 확장할 수 있습니다.

  • jwa:

    다양한 알고리즘을 지원하여 특정 요구 사항에 맞게 확장할 수 있습니다.

  • jsonwebtoken:

    기본적인 기능을 제공하지만, 복잡한 요구 사항에 맞게 확장하기 위해서는 추가적인 코드 작성이 필요할 수 있습니다.

  • passport-jwt:

    Passport.js의 다른 전략과 결합하여 다양한 인증 요구 사항에 맞게 확장할 수 있습니다.

  • express-jwt:

    Express.js의 미들웨어로 쉽게 확장할 수 있으며, 다른 미들웨어와 함께 사용할 수 있습니다.

성능

  • jose:

    복잡한 알고리즘을 지원하지만, 성능에 영향을 미칠 수 있는 추가적인 처리 시간이 필요할 수 있습니다.

  • jwa:

    다양한 알고리즘을 지원하지만, 성능은 선택한 알고리즘에 따라 달라질 수 있습니다.

  • jsonwebtoken:

    간단한 JWT 생성 및 검증을 제공하여 성능이 우수합니다. 그러나 대량의 요청을 처리할 때는 성능 문제가 발생할 수 있습니다.

  • passport-jwt:

    Passport.js의 미들웨어로 작동하여 성능에 미치는 영향이 적습니다.

  • express-jwt:

    미들웨어로 작동하여 요청 처리 중 JWT 검증을 수행하므로 성능에 미치는 영향이 적습니다.

문서화 및 커뮤니티 지원

  • jose:

    문서화가 잘 되어 있지만, 상대적으로 사용자가 적어 커뮤니티 지원이 제한적일 수 있습니다.

  • jwa:

    문서화가 잘 되어 있지만, 특정 알고리즘에 대한 이해가 필요할 수 있습니다.

  • jsonwebtoken:

    광범위한 사용자 기반과 잘 정리된 문서 덕분에 지원이 풍부합니다.

  • passport-jwt:

    Passport.js의 커뮤니티와 함께 사용되므로 지원이 풍부하며, 문서화도 잘 되어 있습니다.

  • express-jwt:

    잘 문서화되어 있으며, Express.js 커뮤니티에서 널리 사용되고 있어 지원이 풍부합니다.

선택 방법: jose vs jwa vs jsonwebtoken vs passport-jwt vs express-jwt

  • jose:

    JWT와 JWK(JSON Web Key)와 같은 다양한 JSON 기반 데이터 형식을 처리해야 할 때 선택하세요. JOSE는 다양한 알고리즘을 지원하며, 복잡한 보안 요구 사항을 처리할 수 있습니다.

  • jwa:

    JWT 서명 및 검증을 위한 알고리즘을 제공하는 라이브러리로, 알고리즘에 대한 세부적인 제어가 필요할 때 선택하세요. JWA는 다양한 암호화 알고리즘을 지원합니다.

  • jsonwebtoken:

    JWT를 생성하고 검증하는 데 필요한 기본적인 기능을 제공하며, 간단한 API를 원할 때 선택하세요. 이 패키지는 널리 사용되며, 문서화가 잘 되어 있어 배우기 쉽습니다.

  • passport-jwt:

    Passport.js와 통합하여 인증 전략을 구현하고자 할 때 선택하세요. 이 패키지는 Passport의 인증 기능을 활용하여 JWT 기반 인증을 쉽게 설정할 수 있습니다.

  • express-jwt:

    Express.js와 함께 사용하여 미들웨어로 JWT를 쉽게 검증하고자 할 때 선택하세요. 이 패키지는 Express 애플리케이션에 통합하기 쉬우며, 요청을 처리하는 동안 JWT를 자동으로 확인합니다.

jose의 README

jose

jose is a JavaScript module for JSON Object Signing and Encryption, providing support for JSON Web Tokens (JWT), JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), JSON Web Key Set (JWKS), and more. The module is designed to work across various Web-interoperable runtimes including Node.js, browsers, Cloudflare Workers, Deno, Bun, and others.

Sponsor

Auth0 by Okta

If you want to quickly add JWT authentication to JavaScript apps, feel free to check out Auth0's JavaScript SDK and free plan. Create an Auth0 account; it's free!

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.

Dependencies: 0

jose has no dependencies and it exports tree-shakeable ESM1.

Documentation

jose is distributed via npmjs.com, jsr.io, jsdelivr.com, and github.com.

example ESM import1

import * as jose from 'jose'

JSON Web Tokens (JWT)

The jose module supports JSON Web Tokens (JWT) and provides functionality for signing and verifying tokens, as well as their JWT Claims Set validation.

Encrypted JSON Web Tokens

The jose module supports encrypted JSON Web Tokens and provides functionality for encrypting and decrypting tokens, as well as their JWT Claims Set validation.

Key Utilities

The jose module supports importing, exporting, and generating keys and secrets in various formats, including PEM formats like SPKI, X.509 certificate, and PKCS #8, as well as JSON Web Key (JWK).

JSON Web Signature (JWS)

The jose module supports digital signature and MAC computation and validation over arbitrary JWS Payloads using the JWS Compact Serialization and the flattened and general JWS JSON Serialization syntaxes (RFC 7515, Section 7).

JSON Web Encryption (JWE)

The jose module supports encryption and authenticated decryption of arbitrary plaintext using the JWE Compact Serialization and the flattened and general JWE JSON Serialization syntaxes (RFC 7516, Section 7).

Other

The following are additional features and utilities provided by the jose module:

Supported Runtimes

The jose module is compatible with JavaScript runtimes that support the utilized Web API globals and standard built-in objects or are Node.js.

The following runtimes are supported (this is not an exhaustive list):

Please note that certain algorithms may not be available depending on the runtime used. You can find a list of available algorithms for each runtime in the specific issue links provided above.

Supported Versions

VersionSecurity Fixes 🔑Other Bug Fixes 🐞New Features ⭐Runtime and Module type
v6.xSecurity Policy✅✅Universal2 ESM1

Specifications

Details
  • JSON Web Signature (JWS) - RFC7515
  • JSON Web Encryption (JWE) - RFC7516
  • JSON Web Key (JWK) - RFC7517
  • JSON Web Algorithms (JWA) - RFC7518
  • JSON Web Token (JWT) - RFC7519
  • JSON Web Key Thumbprint - RFC7638
  • JSON Web Key Thumbprint URI - RFC9278
  • JWS Unencoded Payload Option - RFC7797
  • CFRG Elliptic Curve ECDH and Signatures - RFC8037
  • Fully-Specified Algorithms for JOSE - RFC9864
  • ML-DSA for JOSE - RFC9964

The algorithm implementations in jose have been tested using test vectors from their respective specifications as well as RFC7520.

Footnotes

  1. CJS style let jose = require('jose') is possible in Node.js versions where the require(esm) feature is enabled by default (^20.19.0 || ^22.12.0 || >= 23.0.0). ↩ ↩2 ↩3

  2. Assumes runtime support of WebCryptoAPI and Fetch API ↩