# Login via username

**URL:** <https://community.dreamfactory.com/t/login-via-username/3760>\
**Category:** uncategorized\
**Tags:** authentication\
**Created:** [April 6, 2017, 12:17pm UTC](https://community.dreamfactory.com/t/login-via-username/3760 "2017-04-06T12:17:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [April 6, 2017, 12:17pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/1 "2017-04-06T12:17:37Z")

</div>

Hi,  
I’ve noticed there is a “username” field in the database, is it possible to make a login request using this username and not an email?

Thanks

---

<div class="post-metadata">

**Author:** ![mattschaer](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mattschaer/32/914_2.png) [@mattschaer](https://community.dreamfactory.com/u/mattschaer)\
**Post date:** [April 11, 2017, 6:38pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/2 "2017-04-11T18:38:50Z")

</div>

@adib currently only email is supported for login.

---

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [April 13, 2017, 9:37am UTC](https://community.dreamfactory.com/t/login-via-username/3760/3 "2017-04-13T09:37:57Z")

</div>

Hi,  
Thankyou for your reply.

---

<div class="post-metadata">

**Author:** ![mattschaer](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mattschaer/32/914_2.png) [@mattschaer](https://community.dreamfactory.com/u/mattschaer)\
**Post date:** [April 13, 2017, 2:45pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/4 "2017-04-13T14:45:20Z")

</div>

@adib there is some discussion of this right now actually, we don’t have timeline but I’m sure if you subscribe to DF Newsletter you’ll receive release notes pretty regularly to stay apprised of when this might release.

---

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [April 15, 2017, 7:50am UTC](https://community.dreamfactory.com/t/login-via-username/3760/5 "2017-04-15T07:50:32Z")

</div>

Thank, I’ll be sure to subscribe. I use dream factory on two of my ongoing project and I’m planning to use it on my future projects. It really speeds up the development time.

---

<div class="post-metadata">

**Author:** ![mattschaer](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mattschaer/32/914_2.png) [@mattschaer](https://community.dreamfactory.com/u/mattschaer)\
**Post date:** [May 24, 2017, 5:48pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/6 "2017-05-24T17:48:57Z")

</div>

@adib this has been implemented as of our last release, check it out!

---

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [June 22, 2017, 6:04am UTC](https://community.dreamfactory.com/t/login-via-username/3760/7 "2017-06-22T06:04:03Z")

</div>

Awesome. Thank you very much.

---

<div class="post-metadata">

**Author:** ![sadamchami](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sadamchami](https://community.dreamfactory.com/u/sadamchami)\
**Post date:** [July 7, 2017, 3:46am UTC](https://community.dreamfactory.com/t/login-via-username/3760/8 "2017-07-07T03:46:04Z")

</div>

How to use new session login with username?

---

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [July 21, 2017, 2:39am UTC](https://community.dreamfactory.com/t/login-via-username/3760/9 "2017-07-21T02:39:40Z")

</div>

Hi,  
I’ve been trying to setup login using the username. I’ve changed the .env file, I also change the setting in the “service-system-config” . When I called /user/session using username I’ve still got an error “Login request is missing required email”. Is there any step that I miss? Thanks

---

<div class="post-metadata">

**Author:** ![adib](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/adib/32/919_2.png) [@adib](https://community.dreamfactory.com/u/adib)\
**Post date:** [July 21, 2017, 8:06am UTC](https://community.dreamfactory.com/t/login-via-username/3760/10 "2017-07-21T08:06:49Z")

</div>

Whoops. My Bad. I actually forget to uncomment the line in .env file. Now It works gorgeously!.

---

<div class="post-metadata">

**Author:** ![cgeorges](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@cgeorges](https://community.dreamfactory.com/u/cgeorges)\
**Post date:** [July 21, 2017, 12:42pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/11 "2017-07-21T12:42:09Z")

</div>

Hi everybody,

@adib, Can you explain a bit more. I try to make the same things, but it doesn’t work.  
I put `DF_LOGIN_ATTRIBUTE=username` in files ‘.env’ and ‘.env-dist’. I check ‘Login with Username’ in Service -\> System -\> Config. All services have been restarted.  
But when I POST `{ "username": "my_username", "password": "secret" }` on /user/session  
I always have error 400 : `Login request is missing required email.`

Did I miss something ?

PS: I work with DF 2.7.0-1 on windows

---

<div class="post-metadata">

**Author:** ![cgeorges](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@cgeorges](https://community.dreamfactory.com/u/cgeorges)\
**Post date:** [July 21, 2017, 2:07pm UTC](https://community.dreamfactory.com/t/login-via-username/3760/12 "2017-07-21T14:07:36Z")

</div>

Ok My Bad.

Just forgot to execute  
`php artisan cache:clear`  
`php artisan config:clear`  
`php artisan df:setup`
