# Getting "blocked" variable into CustomDB

**URL:** <https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385>\
**Category:** Get Help\
**Tags:** blocked-account, custom-database\
**Created:** [July 5, 2017, 1:17pm UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385 "2017-07-05T13:17:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [July 5, 2017, 1:17pm UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/1 "2017-07-05T13:17:51Z")

</div>

Is there any way to get the “blocked” variable into my CustomDB so i can block the users access regardless of the expire date? This will introduce server-side statefulness, which i am aware of.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 6, 2017, 7:18am UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/2 "2017-07-06T07:18:33Z")

</div>

What block are you referring to, e.g. Brute Force Protection (single user, or multiple user), or a general user block?  
Please describe the use case for this.

---

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [July 7, 2017, 12:27am UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/3 "2017-07-07T00:27:15Z")

</div>

i would assume so, there is only one variable called “blocked”, which also can be triggered manually, and most likely also used by brute force protection.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 11, 2017, 5:27pm UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/4 "2017-07-11T17:27:38Z")

</div>

The `blocked` attribute in the user profile is associated with a manual block and to my knowledge has no associated expiration time; it’s blocked until manually unblocked so I’m likely missing something in relation to your requirement of blocking regardless expiration time as there’s no expiration time that I’m aware. This is also something available to all connections types and not specific to custom databases so even if the user authenticates successfully against the IdP, in this case your custom database, the authentication transaction would still fail if the user is blocked.

As mentioned before, please expand on the use case for needing that value available in the custom database script. Also have in mind that you can query that value through a Management API call, however, doing so at each login is not recommended as rate limits for Management API calls may end-up affecting the number of authentication transactions you would be able to complete.

---

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [July 11, 2017, 5:59pm UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/5 "2017-07-11T17:59:57Z")

</div>

I understand. I would like to use this attribute to block the user from consuming endpoints on the database even before the token has expired. As the database auth0 is using is the one shared with our API, so it will be quite accessible already for queries.

---

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [July 11, 2017, 6:00pm UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/6 "2017-07-11T18:00:41Z")

</div>

So technically i just need to change the custom script?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/getting-blocked-variable-into-customdb/7385/7 "2018-03-02T05:55:10Z")

</div>


