PHPackages                             refact-be/odoo-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. refact-be/odoo-bundle

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

refact-be/odoo-bundle
=====================

Symfony Bundle to use Odoo as authentication provider

0.1.0(6y ago)071PHPPHP ^7.0

Since Jul 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/refact-be/odoo-bundle)[ Packagist](https://packagist.org/packages/refact-be/odoo-bundle)[ RSS](/packages/refact-be-odoo-bundle/feed)WikiDiscussions master Synced 3d ago

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

Odoo bundle
===========

[](#odoo-bundle)

The Symfony bundle ships with two authentication mechanisms you can use to authenticate users from an Odoo instance

Installation:
-------------

[](#installation)

```
composer require refact-be/odoo-bundle

```

Add the bundles to bundles.php:

```
Refact\OdooBundle\OdooBundle::class => ['all' => true]

```

Create a configuration file for the Odoo bundle (config/packages/odoo.yaml)

```
odoo:
    url: http://localhost:8069
    database: database_name
    admin_id: 2
    admin_pass: admin

    # required only for the sso mechanism
    sso_secret: supersecret

    #role_mapping:
    #    1: ROLE_USER_TYPES_INTERNAL_USER
    #    9: ROLE_USER_TYPES_PORTAL

```

The role\_mapping config is optional but allows deep integration of the Odoo Groups and Symfony Roles

Use the odoo:get-roles command to dump the role\_mapping automatically:

```
bin/console odoo:get-roles

```

Read data from Odoo:

```
/**
 * @Route("/me", name="me_details")
 * @IsGranted("ROLE_USER_TYPES_PORTAL")
 */
public function users(Odoo $odoo, TokenStorageInterface $tokenStorage)
{
    $token = $tokenStorage->getToken();

    dump($token);

    dd($odoo->rpc('object', 'execute_kw', ['res.users', 'search_read', [[['login', '=', $token->getUser()]]]])[0]);
}

```

Odoo Form Login
---------------

[](#odoo-form-login)

This form extends the traditional Symfony Form Login which allows most of its options to be reused

config/packages/security.yaml

```
security:
    firewalls:
        main:
            anonymous: true

            form_login_odoo:
                #login_path: login

            logout:
                path: logout

    role_hierarchy:
        # allow internal users to access pages restricted to portal users
        ROLE_USER_TYPES_INTERNAL_USER: ROLE_USER_TYPES_PORTAL

```

controller:

```
/**
 * @Route("/login", name="login")
 * @Route("/login_check", name="login_check")
 * @Route("/logout", name="logout")
 */
public function login(AuthenticationUtils $authenticationUtils)
{
    return $this->render('app/login.html.twig', [
        'username' => $authenticationUtils->getLastUsername(),
        'error' => $authenticationUtils->getLastAuthenticationError(),
    ]);
}

```

templates/app/login.html.twig

```
{% if error %}
    {{ error.messageKey }}
{% endif %}

    Log in

```

Odoo Single Sign-On (SSO)
-------------------------

[](#odoo-single-sign-on-sso)

If users are already logged in in Odoo, it might be a bad user experience to repeat the credentials in the Symfony application. SSO allows bridging the two applications to share authentication information.

This mechanism requires to install and configure the SSO addon in your Odoo instance. See  for additional details

config/packages/security.yaml

```
security:
    firewalls:
        main:
            anonymous: true

            sso_odoo:

            logout:
                path: logout

```

config/routes.yaml

```
login:
    path: /login
login_check:
    path: /login_check
logout:
    path: /logout

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

2497d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/543477cef404854fa2127a396dd56bed6c36c363a03155a543722336dff9d096?d=identicon)[guillaumesmo](/maintainers/guillaumesmo)

---

Top Contributors

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

---

Tags

odoossosso-authenticationsymfonysymfony-bundle

### Embed Badge

![Health badge](/badges/refact-be-odoo-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/refact-be-odoo-bundle/health.svg)](https://phpackages.com/packages/refact-be-odoo-bundle)
```

###  Alternatives

[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[contao/manager-bundle

Provides the Contao Managed Edition

181.3M61](/packages/contao-manager-bundle)

PHPackages © 2026

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