# Battle tested authentication middleware for web app

**URL:** <https://discourse.slimframework.com/t/battle-tested-authentication-middleware-for-web-app/1069>\
**Category:** Questions\
**Created:** [January 12, 2017, 9:34am UTC](https://discourse.slimframework.com/t/battle-tested-authentication-middleware-for-web-app/1069 "2017-01-12T09:34:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elsueco](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@elsueco](https://discourse.slimframework.com/u/elsueco)\
**Post date:** [January 12, 2017, 9:34am UTC](https://discourse.slimframework.com/t/battle-tested-authentication-middleware-for-web-app/1069/1 "2017-01-12T09:34:13Z")

</div>

I am using Slim 3 as a backend to a web app and am relatively new to Slim. What is the best authentication middleware that I should use to have the app users login and be authenticated? Not rocket science to write myself but I prefer to use some already battle tested middleware to get the most secure solution.

Thanks!

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [January 12, 2017, 12:39pm UTC](https://discourse.slimframework.com/t/battle-tested-authentication-middleware-for-web-app/1069/2 "2017-01-12T12:39:16Z")

</div>

I’m not aware of any user/pw based auth middleware for Slim that is released as an open project. You can find a big list of [PSR-7 middleware here](https://github.com/oscarotero/psr7-middlewares), but I don’t see any for the type of auth system I think you’re looking for. For an example using HTTP Basic Auth, check out [tuupola/slim-basic-auth](https://github.com/tuupola/slim-basic-auth) and for a JWT example have a look at [tuupola/slim-jwt-auth](https://github.com/tuupola/slim-jwt-auth). Those might give you some ideas.

---

<div class="post-metadata">

**Author:** ![elsueco](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@elsueco](https://discourse.slimframework.com/u/elsueco)\
**Post date:** [January 13, 2017, 1:08pm UTC](https://discourse.slimframework.com/t/battle-tested-authentication-middleware-for-web-app/1069/3 "2017-01-13T13:08:11Z")

</div>

Thanks. Will do something that fits my project, with inspirations from the links you sent.
