# Likely bug: oauth2\_client USERNAME = email issue

**URL:** <https://forum.gitea.com/t/likely-bug-oauth2-client-username-email-issue/3223>\
**Category:** General\
**Created:** [April 28, 2021, 2:08pm UTC](https://forum.gitea.com/t/likely-bug-oauth2-client-username-email-issue/3223 "2021-04-28T14:08:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzinas-adv](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/kzinas-adv/32/1285_2.png) [@kzinas-adv](https://forum.gitea.com/u/kzinas-adv)\
**Post date:** [April 28, 2021, 2:08pm UTC](https://forum.gitea.com/t/likely-bug-oauth2-client-username-email-issue/3223/1 "2021-04-28T14:08:58Z")

</div>

HI,

If you registering new user through oauth2 you should be able to set strict username for example “username part of the email attribute”  
It is described in [https://docs.gitea.io/en-us/administration/config-cheat-sheet/](https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-client-oauth2_client)  
But all I got is empty Username field which you can fill anything.  
My app.ini config:

[oauth2\_client]  
USERNAME = email

[service]  
REGISTER\_EMAIL\_CONFIRM = true  
ENABLE\_NOTIFY\_MAIL = false  
DISABLE\_REGISTRATION = false  
ALLOW\_ONLY\_EXTERNAL\_REGISTRATION = true  
ENABLE\_CAPTCHA = false  
REQUIRE\_SIGNIN\_VIEW = false  
DEFAULT\_KEEP\_EMAIL\_PRIVATE = false  
DEFAULT\_ALLOW\_CREATE\_ORGANIZATION = false  
DEFAULT\_ENABLE\_TIMETRACKING = true

Is my config wrong or is it bug? it looks to me like a bug.  
go-gitea 1.14.1

/Domantas

---

<div class="post-metadata">

**Author:** ![kzinas-adv](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/kzinas-adv/32/1285_2.png) [@kzinas-adv](https://forum.gitea.com/u/kzinas-adv)\
**Post date:** [April 29, 2021, 11:03am UTC](https://forum.gitea.com/t/likely-bug-oauth2-client-username-email-issue/3223/2 "2021-04-29T11:03:44Z")

</div>

Looks this feature not yet in PROD
