-
Notifications
You must be signed in to change notification settings - Fork 307
How To for OnBehalfOf services access sample
Yury Opolev edited this page Oct 22, 2020
·
8 revisions
In order to access various services within a tenant on behalf of any user in the tenant, you'll need to set up an Azure AD Application with delegated permissions to the services, then grant admin consent to the services. Here are the steps for doing this:
Setup single tenant application:
- Sign into Azure portal under admin user, and add Application registration:
- Under supported Account types, specify “Accounts in this organizational directory only”, and register the application:
- Add Redirect URI to the application, go to “Authentication” -> “Platform Configurations” -> “Add a platform”, choose “Web” and specify “Redirect Uri”. Set the Redirect Uri value to
https://businesscentral.dynamics.com/OAuthLanding.htm
, so it will be possible to receive information from Azure AD to acquire tokens for the application:
- Add client secret:
- Add Application ID URI, go to “Overview” -> “Add an Application ID URI” -> “Set”. Normally Application ID URI will be api://{Application ID}:
- Now, add delegated permissions for this application, so it can access all needed services, such as Business Central, SharePoint, Power BI, Graph, and so on. Go to "API Permissions" -> "Add a permission", and add the required permissions:
- After permissions are added, grant admin consent to it:
Now, the application is fully setup. It has an Application ID URI, a Secret, and a Redirect URI, and has delegated access to all needed services within the given tenant. This means that it is now possible to acquire on-behalf tokens.