Reputation: 77
i have some questions regarding adding permissions manually to app registrations
Im adding permissions to the app via the UX and click on save. After that these permissions are added to the requiredressourceaccess attribute right?
After that I click on “grant permissions” -> permissons are added to the service principal, right?
When checking the service principal after that I see the permissions are added via admin consent. Is this also possible with a user consent? Maybe im wrong here, and this is not needed but im wondering why the only option to do that is with a global admin which then results in an admin consent.
Also some permissions are stating that admin is not required.
If I just do step a and add permissions, click safe, permissions are added to requiredressourceacces
Best Regards Thomas
Upvotes: 0
Views: 176
Reputation: 9411
Elisol has made clear about Grant permissions, This answer is just a supply to elisol's and reply to your 5rd quesiton:
If I just do step a and add permissions, click safe, permissions are added to requiredressourceacces. Does the user have to consent now to that permissions when accessing the app via. the my apps portal? I tried to repro, but it did not work.
For Azure AD v1 endpoint, the permissions is static. Once user has consented once it will not change. So,we have a Grant permissions for doing admin consent in advance. For your 5th questions , elisol has explained very well, but I want to make clear that the old user(who has done consent once) won't be promoted to consent. He/she should only have the permissions which consented before. If you want the user to have new permissions ,App should force the user to do re-consent by adding prompt=consent
or prompt=admin_consent
to the authorization URL.
If you want to specify the permissions your app needs dynamically, you can think to use AAD v2 endpoint. See here for difference between AAD v1 adn v2 enpoint.
I'm not sure what error message did you get( It's the reason I asked you post more details about your scenario). So, I list 2 situations you may came across.
1.If you came across that the user still needs to do consent after granting permissions from Azure portal:
As @junnas said, one reason may be that your App request contains prompt=consent
or prompt=admin_consent
to force re-consent. You can refer to his blog to try to fix it.
2.You cannot access to your App without enough permission(may have error massage with don't have access to this app).
First, ensure you have added enough permissions in Azure portal and granted permissions. Second, check if the resource
in your request is correct WebAPP/API permissions. Third, Check if that have your define the App Roles and assign different role for the user (It calls Group based Access control).
Hope this helps.
Upvotes: 0
Reputation: 328
Answering in order:
Upvotes: 1