# Slim framework admin credential

**URL:** <https://discourse.slimframework.com/t/slim-framework-admin-credential/1428>\
**Category:** Questions\
**Created:** [April 23, 2017, 6:54pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428 "2017-04-23T18:54:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yazee](https://avatars.discourse-cdn.com/v4/letter/y/48db29/32.png) [@Yazee](https://discourse.slimframework.com/u/Yazee)\
**Post date:** [April 23, 2017, 6:54pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/1 "2017-04-23T18:54:13Z")

</div>

Hi !

May i know how to add an admin credential to slim framework web application or edit a previous one

Thank You 🙂

---

<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:** [April 23, 2017, 7:29pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/2 "2017-04-23T19:29:43Z")

</div>

Hi @Yazee,

Slim does not come with any authentication package, however there are many you can implement. The package you implement will depend on your needs. If something basic from the browser you might try [tuupola/slim-basic-auth](https://github.com/tuupola/slim-basic-auth). I use [auraphp/Aura.Auth](https://github.com/auraphp/Aura.Auth) for a few of my projects. From an API you might want to look at something like [thephpleague/oauth2-server](https://github.com/thephpleague/oauth2-server).

---

<div class="post-metadata">

**Author:** ![Yazee](https://avatars.discourse-cdn.com/v4/letter/y/48db29/32.png) [@Yazee](https://discourse.slimframework.com/u/Yazee)\
**Post date:** [April 24, 2017, 11:18am UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/3 "2017-04-24T11:18:05Z")

</div>

Thank You for ur feedback 🙂

---

<div class="post-metadata">

**Author:** ![praba1978](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@praba1978](https://discourse.slimframework.com/u/praba1978)\
**Post date:** [September 23, 2017, 8:49am UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/4 "2017-09-23T08:49:31Z")

</div>

Hi, Could you please let me know how did you integrated Aura.Auth in SLIM auth. Any some example or some steps to integrate the same?

---

<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:** [September 23, 2017, 11:56am UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/5 "2017-09-23T11:56:07Z")

</div>

In my container I define how the `Auth::class`, `AuthFactory::class`, and `AdapterInterface::class` should be setup, as per the [Instantiation](https://github.com/auraphp/Aura.Auth#instantiation) section of the docs.

I created an `AuthController` to handle login login and logout routes which takes the `AdapterInterface` and checks the credentials against the LoginService, logs the user out, etc. See the [services](https://github.com/auraphp/Aura.Auth#services) part of the docs.

Then I created a `AuthenticationMiddleware` applied to protected routes that checks the `isValid()` method of the `Auth` object and returns a `403` if it isn’t valid.

---

<div class="post-metadata">

**Author:** ![praba1978](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@praba1978](https://discourse.slimframework.com/u/praba1978)\
**Post date:** [September 23, 2017, 5:20pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/6 "2017-09-23T17:20:54Z")

</div>

Hi

Thanks a lot for your prompt reply with examples

Could you pls let me know how to did you handle authorization part as well?

I am very new to SLIM but still i am passionate to learn this middleware part completely.

It would be nice if you are able to share some glimpse of code in slim container part and controller related on the same.

---

<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:** [September 30, 2017, 1:19pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/7 "2017-09-30T13:19:18Z")

</div>

I’m not using Aura.Auth for authorization, instead I’m using [zend-permissions-acl](https://docs.zendframework.com/zend-permissions-acl/usage/) or rolling my own. I’ll see if I can find some code samples.

---

<div class="post-metadata">

**Author:** ![praba1978](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@praba1978](https://discourse.slimframework.com/u/praba1978)\
**Post date:** [September 30, 2017, 6:53pm UTC](https://discourse.slimframework.com/t/slim-framework-admin-credential/1428/8 "2017-09-30T18:53:41Z")

</div>

Thanks Sir for your help
