# Zend-expressive-authentication-session dependency problem

**URL:** <https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599>\
**Category:** Mezzio\
**Tags:** expressive\
**Created:** [May 28, 2018, 3:14pm UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599 "2018-05-28T15:14:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelB](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MichaelB](https://discourse.laminas.dev/u/MichaelB)\
**Post date:** [May 28, 2018, 3:14pm UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/1 "2018-05-28T15:14:10Z")

</div>

Hi,

I just tried to add zend-expressive-authentication + zend-expressive-authentication-session in a expressive project but i have a dependency problem… zend-expressive-authentication is 0.5.0 now. I know this modules still in dev but how to resolve that? Downgrade zend-expressive-authentication to 0.4.0? Or wait next zend-expressive-authentication-session version ?

Thanks!

> Using version ^0.4.1 for zendframework/zend-expressive-authentication-session  
> ./composer.json has been updated  
> Loading composer repositories with package information  
> Updating dependencies (including require-dev)  
> Your requirements could not be resolved to an installable set of packages.

> Problem 1  
> - Installation request for zendframework/zend-expressive-authentication-session ^0.4.1 → satisfiable by zendframework/zend-expressive-authentication-session[0.4.1].  
> - zendframework/zend-expressive-authentication-session 0.4.1 requires zendframework/zend-expressive-authentication ^0.4.0 → satisfiable by zendframework/zend-expressive-authentication[0.4.0, 0.4.x-dev] but these conflict with your requirements or minimum-stability.

---

<div class="post-metadata">

**Author:** ![xtreamwayz](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/xtreamwayz/32/27_2.png) [@xtreamwayz](https://discourse.laminas.dev/u/xtreamwayz)\
**Post date:** [May 28, 2018, 3:27pm UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/2 "2018-05-28T15:27:12Z")

</div>

zend-expressive-authentication-session needs an update to be compatible with zend-expressive-authentication.

You can install both with `composer require zend-expressive-authentication-basic` or add this manually to your composer.json file:

```json
{
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "zendframework/zend-expressive-authentication": "^0.4.0",
        "zendframework/zend-expressive-authentication-basic": "^0.3.0"
    }
}

```

Zend Framework uses semver for versioning. This means that every minor version increase below 1.0.0 is considered a BC break. That’s why composer is not upgrading from 0.4 to 0.5.

---

<div class="post-metadata">

**Author:** ![MichaelB](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MichaelB](https://discourse.laminas.dev/u/MichaelB)\
**Post date:** [May 29, 2018, 12:08pm UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/3 "2018-05-29T12:08:16Z")

</div>

Thanks for your answer! and for the [#16](https://github.com/zendframework/zend-expressive-authentication-session/pull/16) PR 😉

---

<div class="post-metadata">

**Author:** ![MichaelB](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MichaelB](https://discourse.laminas.dev/u/MichaelB)\
**Post date:** [June 18, 2018, 9:42am UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/4 "2018-06-18T09:42:31Z")

</div>

@xtreamwayz When do you think your PR [#16](https://github.com/zendframework/zend-expressive-authentication-session/pull/16) will be merged?

Do you think it will have another BC break before a final release? (i mean also in all the authentication flow)

---

<div class="post-metadata">

**Author:** ![xtreamwayz](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/xtreamwayz/32/27_2.png) [@xtreamwayz](https://discourse.laminas.dev/u/xtreamwayz)\
**Post date:** [June 19, 2018, 5:36am UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/5 "2018-06-19T05:36:21Z")

</div>

> [@MichaelB](#):
>
> When do you think your PR [#16](https://github.com/zendframework/zend-expressive-authentication-session/pull/16) will be merged?

Yesterday.

> [@MichaelB](#):
>
> Do you think it will have another BC break before a final release? (i mean also in all the authentication flow)

I don’t know. I would say use it and give your feedback. When all related components are found stable it will be tagged as a stable release.

---

<div class="post-metadata">

**Author:** ![MichaelB](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MichaelB](https://discourse.laminas.dev/u/MichaelB)\
**Post date:** [June 19, 2018, 9:31am UTC](https://discourse.laminas.dev/t/zend-expressive-authentication-session-dependency-problem/599/6 "2018-06-19T09:31:17Z")

</div>

Good news! Thanks @xtreamwayz & @matthew!

Now i can get my user\_id easily for the current logged user 😉

```
    $user = $request->getAttribute(UserInterface::class);
    $userId = (int) $user->getDetail('user_id');
    ...
    $datas = $this->testModel->getAllByUser($userId);
    ...
```
