PHPackages                             cosmonova-rnd/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cosmonova-rnd/auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

cosmonova-rnd/auth
==================

Simple OAuth 2 library for Symfony projects

0.7.2(8y ago)09MITPHP

Since Jan 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CosmonovaRnD/Auth)[ Packagist](https://packagist.org/packages/cosmonova-rnd/auth)[ RSS](/packages/cosmonova-rnd-auth/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Simple OAuth 2.0 library for Symfony 4 projects
===============================================

[](#simple-oauth-20-library-for-symfony-4-projects)

At this time, library allow to auth using JWT with OAuth2 `Authorization Code` flow.

Installation
============

[](#installation)

Install package using composer

> composer req cosmonova-rnd/auth

Basic configuration
===================

[](#basic-configuration)

1. Enable session handler in your application

```
framework:
    session:
        handler_id: ~
```

2. Configure DB connection, then add new entity manager `auth` to your application config

```
doctrine:
    orm:
        entity_managers:
            auth:
                connection: default ## may be your custom connection
                default_repository_class: 'CosmonovaRnD\Auth\Repository\UserRepository'
                mappings:
                    Auth:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/vendor/cosmonova-rnd/auth/src/Entity'
                        prefix: 'CosmonovaRnD\Auth\Entity'
                        alias: Auth
```

3. Configure encoder and provider in `security` section

```
security:
    encoders:
        CosmonovaRnD\Auth\Entity\User:
            algorithm: plaintext
    providers:
        auth_provider:
            id: CosmonovaRnD\Auth\Security\UserProvider
```

Configuration of authentication through OAuth2 service (`authorization_code` flow)
==================================================================================

[](#configuration-of-authentication-through-oauth2-service-authorization_code-flow)

1. Configure your main firewall to use package provider and set login form config like bellow

```
security:
    firewalls:
        main:
            ### If you want to use OAuth2 Access Code authentication flow
            provider: auth_provider
            anonymous: ~
            logout: ~
            form_login:
                login_path: auth
                check_path: auth
```

2. Add access control rules

```
access_control:
    - { path: ^/auth, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/, roles: IS_AUTHENTICATED_FULLY }
```

Configuration for checking authentication using JSON Web Token
==============================================================

[](#configuration-for-checking-authentication-using-json-web-token)

In this case we use `Authorization: Bearer ` header

1. Configure any provider (such like a `memory`)

```
security:
    providers:
        in_memory: { memory: ~ }
```

2. Then add to your main firewall this provider and guard authenticator

```
security:
    firewalls:
        main:
            provider: in_memory
            guard:
                authenticators:
                    - CosmonovaRnD\Auth\Security\Authenticator\JwtAuthenticator
            stateless: true
```

3. Also configure your access rules if needed

```
access_control:
    - { path: ^/, roles: IS_AUTHENTICATED_FULLY }
```

### @ Cosmonova | Research &amp; Development

[](#-cosmonova--research--development)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

3088d ago

### Community

Maintainers

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

---

Top Contributors

[![BesedinSasha](https://avatars.githubusercontent.com/u/2121842?v=4)](https://github.com/BesedinSasha "BesedinSasha (1 commits)")

---

Tags

auth2jwtsymfony4

### Embed Badge

![Health badge](/badges/cosmonova-rnd-auth/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M715](/packages/sylius-sylius)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k56](/packages/open-dxp-opendxp)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k3](/packages/web-auth-webauthn-framework)

PHPackages © 2026

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