PHPackages                             ridibooks/internal-auth - 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. ridibooks/internal-auth

ActiveLibrary

ridibooks/internal-auth
=======================

Ridibooks Internal Auth

v0.0.1(6y ago)09.4k—0%MITPHPCI failing

Since Feb 27Pushed 6y ago4 watchersCompare

[ Source](https://github.com/ridi/php-internal-auth)[ Packagist](https://packagist.org/packages/ridibooks/internal-auth)[ RSS](/packages/ridibooks-internal-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

php-internal-auth
=================

[](#php-internal-auth)

[![Build Status](https://camo.githubusercontent.com/f32a526b7017069e174ee849edc0710b673284ad32e5646e6b6f3b05dace30e6/68747470733a2f2f7472617669732d63692e6f72672f726964692f7068702d696e7465726e616c2d617574682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ridi/php-internal-auth)

소개
--

[](#소개)

- 내부 서비스 간 통신시 인증을 위한 PHP 라이브러리입니다.
- Ridi 스타일 가이드([내부 서비스간의 SSO](https://github.com/ridi/style-guide/blob/master/API.md#%EB%82%B4%EB%B6%80-%EC%84%9C%EB%B9%84%EC%8A%A4%EA%B0%84%EC%9D%98-sso))에 따라 작성 되었습니다.
- JWK Caching 를 선택적으로 지원합니다. [psr-6](https://www.php-fig.org/psr/psr-6/)의 구현체를 JwtTokenValidator에 주입하면 캐싱 기능을 사용할 수 있습니다.

Requirements
------------

[](#requirements)

- `PHP 7.2` or higher
- `php7.2-gmp` web-token decryption 모듈을 위해서는 php7.2-gmp 를 os 내에 설치해줘야 합니다. 따라서 이 라이브러리 클라이언트들의 OS 혹은 도커 이미지 내에 꼭 설치해주시길 바랍니다. [참고 PR](https://github.com/ridibooks-docker/viewer-php/pull/1)

Installation
------------

[](#installation)

```
composer require ridibooks/internal-auth

```

Usage
-----

[](#usage)

### `JwtGenerator`

[](#jwtgenerator)

```
use Ridibooks\InternalAuth\Authorization\Generator\JwtGenerator;

$key_config = [
    '... issuer service name  ...' => [
        'kid' => '... key id ...',
        'key' => '... rsa private key ...',
    ]
];

$jwt_generator = new JwtGenerator($key_config);
$token = $jwt_generator->generate(
    '... issuer service name  ...',
    '... audience service name ...'
)
```

### `Authorizer, JwtValidator Without Caching`

[](#authorizer-jwtvalidator-without-caching)

```
use Ridibooks\InternalAuth\Authorization\Validator\JwtValidator;
use Ridibooks\InternalAuth\Authorizer;

$internal_auth_token = '...';

try {
    $jwk_url = $this->configs['jwk_url'];
    $validator = new JwtValidator($jwk_url);

    $authorizer = new Authorizer($validator);
    $authorizer->authorize($internal_auth_token, [InterService.Account]);
} catch (AuthorizationException $e) {
	// handle exception
}
```

### `Authorizer, JwtValidator With Caching`

[](#authorizer-jwtvalidator-with-caching)

```
use Ridibooks\InternalAuth\Authorization\Validator\JwtValidator;
use Ridibooks\InternalAuth\Authorizer;

$internal_auth_token = '...';

try {
    $jwk_url = $this->configs['jwk_url'];
    $cache_item_pool = new FilesystemAdapter(); // [psr-6](https://www.php-fig.org/psr/psr-6/) Implementation Adaptor
    $validator = new JwtValidator($jwk_url, $cache_item_pool);

    $authorizer = new Authorizer($validator);
    $authorizer->authorize($internal_auth_token, [InterService.Account]);
} catch (AuthorizationException $e) {
	// handle exception
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8260c131d6a3a12a327d78328de6f99203187abacd4571ec2cfd4dfeb4a1b2cb?d=identicon)[ridi](/maintainers/ridi)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ridibooks-internal-auth/health.svg)

```
[![Health](https://phpackages.com/badges/ridibooks-internal-auth/health.svg)](https://phpackages.com/packages/ridibooks-internal-auth)
```

###  Alternatives

[spomky-labs/lexik-jose-bridge

Bridge to allow the use of web-token/jwt-framework with the Lexik JWT Authentication Bundle

35444.0k](/packages/spomky-labs-lexik-jose-bridge)[eveseat/eseye

A Standalone PHP ESI (EVE Swagger Interface) Client Library

5120.3k28](/packages/eveseat-eseye)

PHPackages © 2026

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