Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update permissions-grant-via-msgraph.md #9045

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

LiliamLeme
Copy link
Contributor

You will be able to see the new permission at the Enterprise Applications - PermissionsTab Under the App registration it will be Other Permissions add at the end of the list for API permissions tab. In order to move that permission and activate you need to Grant Admin Consent.

I was following this guide for python and I found a little bit challenge. So adding the things I believe it would make it more clear 1) The object ID for the SP is to be taken from Enterprise Applications.

  1. The user that will pass the credentials to alter the SP must have high permissions to do it so. I was able to do that with one SP added as global administrator and that one given permissions to a second SP. 3) Which libraries for python to be able to use the sample code.

This was my personal step by step:

1 Replace the information client_ID and Client_secret with the SP with high permissions. This first step will represent the credential that must have enough permissions for the next step.

tenant_id = "Replace with Tenant ID"
client_id = "Replace with Service Principal ID that has high permissions" client_secret = "Replace with secret from the SP that has high permissions"

6.2 The next step you will replace with the Service Principal that you will change the permissions. For example adding those 2 permissions. You will use the Object ID as Client_ID that you got from the Enterprise Applications: • User.Read.All
• User.ReadWrite.All
In the code context:
• Resource ID is the Microsoft Graph ID that
• Client_ID is the Object ID from Enterprise Application • App Role id is the ID of the role that you want to change

You will be able to see the new permission at the Enterprise Applications - PermissionsTab
Under the App registration it will be Other Permissions add at the end of the list for API permissions tab. In order to move that permission and activate you need to Grant Admin Consent.



I was following this guide for python and I found a little bit challenge. So adding the things I believe it would make it more clear
1) The object ID for the SP is to be taken from Enterprise Applications.

2) The user that will pass the credentials to alter the SP must have high permissions to do it so. I was able to do that with one SP added as global administrator and that one given permissions to a second SP.
3) Which libraries for python to be able to use the sample code.

This was my personal step by step:

1 Replace the information client_ID and Client_secret with the SP with high permissions. This first step will represent the credential that must have enough permissions for the next step.


tenant_id = "Replace with Tenant ID"
client_id = "Replace with Service Principal ID that has high permissions"
client_secret = "Replace with secret from the SP that has high permissions" 

6.2 The next step you will replace with the Service Principal that you will change the permissions. For example adding those 2 permissions. You will use the Object ID as Client_ID that you got from the Enterprise Applications:
•	User.Read.All
•	User.ReadWrite.All 
In the code context:
•	Resource ID is the Microsoft Graph ID that
•	Client_ID is the Object ID from Enterprise Application
•	App Role id is the ID of the role that you want to change
Copy link

Learn Build status updates of commit 1d02cd4:

✅ Validation status: passed

File Status Preview URL Details
concepts/permissions-grant-via-msgraph.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@jasonjoh jasonjoh added this to the Community Contributions milestone Jan 23, 2024
@Lauragra Lauragra requested a review from FaithOmbongi January 25, 2024 02:51
@Lauragra
Copy link
Contributor

@FaithOmbongi , can you please take a look at this PR and approve?

@FaithOmbongi FaithOmbongi added the area: Entra APIs and issues relating to Microsoft Entra (previously Azure AD) features. label Jan 25, 2024
@FaithOmbongi FaithOmbongi self-assigned this Jan 25, 2024
@FaithOmbongi FaithOmbongi added the area: app model Everything to do with app and service principal APIs and associated objects. label Jan 25, 2024
Copy link
Collaborator

@FaithOmbongi FaithOmbongi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @LiliamLeme for this useful contribution. I've made a few edits and also removed the note "> [!IMPORTANT]

The Service Principal that will be used for the Credentials Authentication must have enough authority to be able to add or remove permissions."

because this requirement is mentioned as the second requirement the prerequisites. Hope this is in order.

@FaithOmbongi FaithOmbongi added content review complete Apply when the content review is complete on a PR. ready to merge Use this label to indicate to the repository admins that your PR is ready to merge into master. labels Jan 25, 2024
Copy link

Learn Build status updates of commit a9fc663:

✅ Validation status: passed

File Status Preview URL Details
concepts/permissions-grant-via-msgraph.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link

Learn Build status updates of commit b31a990:

✅ Validation status: passed

File Status Preview URL Details
concepts/permissions-grant-via-msgraph.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@Lauragra Lauragra merged commit e2abda7 into microsoftgraph:main Jan 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: app model Everything to do with app and service principal APIs and associated objects. area: Entra APIs and issues relating to Microsoft Entra (previously Azure AD) features. content review complete Apply when the content review is complete on a PR. ready to merge Use this label to indicate to the repository admins that your PR is ready to merge into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants