# Password Policy - not username is not enforced via API

**URL:** <https://forum.keycloak.org/t/password-policy-not-username-is-not-enforced-via-api/8725>\
**Category:** Securing applications\
**Created:** [April 26, 2021, 6:38am UTC](https://forum.keycloak.org/t/password-policy-not-username-is-not-enforced-via-api/8725 "2021-04-26T06:38:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rony.Balaga](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rony.Balaga](https://forum.keycloak.org/u/Rony.Balaga)\
**Post date:** [April 26, 2021, 6:38am UTC](https://forum.keycloak.org/t/password-policy-not-username-is-not-enforced-via-api/8725/1 "2021-04-26T06:38:48Z")

</div>

Hi,

I configured to Password Policy with policy type “Not Username”.  
when creating user via the UI console the policy is enforced.  
when I create user / reset password ,with password same as user name, the user is created successfully.

APIs:  
admin/realms/{realm}/users/{id}/reset-password  
admin/realms/{realm}/users

Server Version- 7.0.1

Please advice
