# Flow: Password. Always receive all Scopes when User didin't have Permissions and Rôles

**URL:** <https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138>\
**Category:** Get Help\
**Tags:** password, api-authorization, scope, bug, permissions\
**Created:** [September 21, 2020, 4:03pm UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138 "2020-09-21T16:03:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [September 21, 2020, 4:03pm UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138/1 "2020-09-21T16:03:20Z")

</div>

Hi,  
I create my test unit and for test not Authorization User, I create a new User in Auth0 without Role. But when I run my test, the “Success Exchange” send all Scope value for my Application and not the Scope from User

My Log  
Type: Success Exchange  
Description: Password for Access Token  
Connection: Username-Password-Authentication

{  
“date”: “2020-09-21T15:56:32.382Z”,  
“type”: “sepft”,  
“description”: “Password for Access Token”,  
“connection”: “Username-Password-Authentication”,  
“connection\_id”: “_**",  
“client\_id”: "**_”,  
“client\_name”: “_**",  
“ip”: "**_”,  
“client\_ip”: “_**",  
“user\_agent”: “Other 0.0.0 / Other 0.0.0”,  
“user\_id”: "auth0|**_”,  
“user\_name”: “jenkinnotnauthorized@_**",  
“audience”: "**_”,  
“scope”: “write:App read:App write:Service read:Service”,  
“log\_id”: “_**",  
“\_id”: "**_”,  
“isMobile”: false  
}

In my C# Code, my API Header  
[HttpGet]  
[Route(“serverActions”)]  
[Authorize(AuthenticationSchemes = “Bearer”, Policy = “read:Service”)]

---

<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:** [September 22, 2020, 10:49am UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138/2 "2020-09-22T10:49:19Z")

</div>

Unless someone recently experienced the same exact issue it may be complex to provide you with a definitive answer with the information available. Is it possible for you to share a client identifier and tenant name or at least the tenant region for which you are performing this test?

---

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [September 22, 2020, 11:30am UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138/3 "2020-09-22T11:30:20Z")

</div>

Yes no problem, it’s my test account  
My Profile: [msavard@d-box.com](mailto:msavard@d-box.com)  
Domain: [dev-dhh2j9fp.us.auth0.com](http://dev-dhh2j9fp.us.auth0.com)  
Region: US - Free

My User with all Roles: [jenkin@d-box.com](mailto:jenkin@d-box.com)  
My user with no Role: [jenkinnotnauthorized@d-box.com](mailto:jenkinnotnauthorized@d-box.com)

Both in history have a scope with all Permissions and are able to call all my Authorize C# API fonction with specific policy

---

<div class="post-metadata">

**Author:** ![msavard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msavard/32/14222_2.png) [@msavard](https://community.auth0.com/u/msavard)\
**Post date:** [September 23, 2020, 10:55am UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138/4 "2020-09-23T10:55:47Z")

</div>

I solve with Rule, but isn’t normal this bug

function (user, context, callback) {  
var map = require(‘array-map’);  
var ManagementClient = require(‘auth0@2.17.0’).ManagementClient;  
var management = new ManagementClient({  
token: auth0.accessToken,  
domain: auth0.domain  
});  
var params = { id: user.user\_id};  
management.getUserPermissions(params, function (err, permissions) {  
var permissionNames = ;  
permissions.forEach(function(obj) { permissionNames.push(obj.permission\_name); });  
context.accessToken.scope = permissionNames.join(’ ');  
callback(null, user, context);  
});  
}

---

<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:** [September 23, 2020, 2:33pm UTC](https://community.auth0.com/t/flow-password-always-receive-all-scopes-when-user-didint-have-permissions-and-roles/50138/5 "2020-09-23T14:33:40Z")

</div>

I did not had the opportunity to review this today using the additional information you shared. I expect to be able to do it tomorrow, and yes, I would agree with you that this does not look normal.
