PHPackages                             jubaopen/jwt-authentication-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jubaopen/jwt-authentication-bundle

ActiveSymfony-bundle

jubaopen/jwt-authentication-bundle
==================================

This bundle provides JWT authentication for your Symfony REST API

012PHP

Since Aug 8Pushed 8y ago3 watchersCompare

[ Source](https://github.com/jubaopenTech/JWTAuthenticationBundle)[ Packagist](https://packagist.org/packages/jubaopen/jwt-authentication-bundle)[ RSS](/packages/jubaopen-jwt-authentication-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

JbpJWTAuthenticationBundle
--------------------------

[](#jbpjwtauthenticationbundle)

@(使用说明)\[JbpJWTAuthenticationBundle\]

---

#### 1.生成秘钥（公钥和私钥）

[](#1生成秘钥公钥和私钥)

定位到console所在目录，执行

```
	php console pem:create
```

输入私钥密码生成；

#### 2.引入Bundle

[](#2引入bundle)

在AppKernel中的registerBundles方法中加入：

```
new JubaopenTech\JWTAuthenticationBundle\JbpJWTAuthenticationBundle(),
```

在config.php文件加入以下配置：

```
jbp_jwt_authentication:
    private_key_path: '%kernel.root_dir%/../var/jwt/private.pem'
    public_key_path:  '%kernel.root_dir%/../var/jwt/private.pem'
    pass_phrase:      '私钥密码'
    token_ttl:        3600
    refresh_ttl:      100
    user_identity_field: username
    encoder:
        service:    jbp_jwt_authentication.encoder.default
        crypto_engine:  openssl
        signature_algorithm: RS256
    token_extractors:
        authorization_header:
            enabled: true
            prefix:  '%authorization_prefix%'
            name:    '%authorization_header_key%'
        cookie:
            enabled: false
            name:    '%authorization_prefix%'
        query_parameter:parameter
            enabled: false
            name:    '%authorization_prefix%'
```

#### 3.获取Token

[](#3获取token)

请求地址：`logincheck`请求参数： `_username:用户名``_password:密码（md5）`返回值:

```
	{"token":"token"}
```

#### 4.请求验证

[](#4请求验证)

> 前缀：jwt

请求头部添加`Authorization`参数

```
	$.ajax({
		...
		headers:{
			Authorization:前缀+空格+token
		},
		...
	})
```

###  Health Score

20

—

LowBetter than 16% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a118e4865e4bd5807b9d1694d5e2503bbd1795344d9a1cf56a430a6b96ab7111?d=identicon)[jubaopenTech](/maintainers/jubaopenTech)

---

Top Contributors

[![boystar1988](https://avatars.githubusercontent.com/u/16755539?v=4)](https://github.com/boystar1988 "boystar1988 (15 commits)")[![louishua](https://avatars.githubusercontent.com/u/10300493?v=4)](https://github.com/louishua "louishua (2 commits)")[![jubaopenTech](https://avatars.githubusercontent.com/u/30613717?v=4)](https://github.com/jubaopenTech "jubaopenTech (1 commits)")

### Embed Badge

![Health badge](/badges/jubaopen-jwt-authentication-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/jubaopen-jwt-authentication-bundle/health.svg)](https://phpackages.com/packages/jubaopen-jwt-authentication-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
