Hello @AzureSDE
Welcome to QnA platform and thank you for your query. Based on the information that you shared, I understood that you have below setup:
- App1(Web API) exposed as API with Role1 and Role2 added as scope.
- App2(Client App) where Role1 and Role2 scopes from App1 are added as API permissions.
Since you are using Application Roles, when you request for a token the scope which needs to be used is "/.default" e.g. https://example.com/App1/.default, and you will get both roles in the token. In this case you can't pass a specific scope in your request like https://example.com/App1/Role1. For Application permissions ./default is the only accepted scope, which returns all scopes added under API permissions blade of the Client App (App2).
As you have mentioned, you removed Role2 from the API permissions blade of App2. In that case, you should only get Role1 in the token when the scope in the authentication request is https://example.com/App1/.default
In short, all you need to do is remove the permissions from API permissions blade of your client application and you shouldn't get that role in the token after that. Make sure you revoke admin consent and remove the permission and acquire a new token after that.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.