# Managing users with auth0 for jenkins

**URL:** <https://community.auth0.com/t/managing-users-with-auth0-for-jenkins/101536>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [March 1, 2023, 10:46am UTC](https://community.auth0.com/t/managing-users-with-auth0-for-jenkins/101536 "2023-03-01T10:46:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratap.gudimetla](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pratap.gudimetla/32/45028_2.png) [@pratap.gudimetla](https://community.auth0.com/u/pratap.gudimetla)\
**Post date:** [March 1, 2023, 10:46am UTC](https://community.auth0.com/t/managing-users-with-auth0-for-jenkins/101536/1 "2023-03-01T10:46:59Z")

</div>

We are using auth0 for jenkins login and some other tools  
Is there any way that we can restrict specific user in authzero to access only jenkins

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 2, 2023, 3:01am UTC](https://community.auth0.com/t/managing-users-with-auth0-for-jenkins/101536/3 "2023-03-02T03:01:28Z")

</div>

Hi @pratap.gudimetla,

Welcome to the Auth0 Community!

> [@pratap.gudimetla](#):
>
> Is there any way that we can restrict specific user in authzero to access only jenkins

Yes, you can control who has access to your application by using a [Post-Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow#access-control).

In the script, you can create a list of whitelisted users who are allowed access.

For example:

```auto
/**
 * @param {Event} event - Details about the user and the context in which they are logging in.
 * @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
 */
exports.onExecutePostLogin = async (event, api) => {
  const whitelist = ["testuser@example", "testuser2@example.com"]
  if (!whitelist.includes(event.user.email)) {
    api.access.deny('invalid_request', "Access from your email address is not allowed.");
  }
};

```

I hope this helps!

Please let me know how this works for you.

Thanks,  
Rueben

---

<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 16, 2023, 3:01am UTC](https://community.auth0.com/t/managing-users-with-auth0-for-jenkins/101536/4 "2023-03-16T03:01:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
