-
Notifications
You must be signed in to change notification settings - Fork 307
How to Use BCServicesAccess sample extension
Yury Opolev edited this page Oct 23, 2020
·
4 revisions
This is how-to for BCServicesAccess sample usage.
Prerequisites:
- Business Central 17.1 or later
- Registered Application in your tenant in Azure AD, see How-To here. To complete the steps that follow, you'll need information about the registered application, which you can get from the Azure portal.
- Install "Sample Services Access" extension.
- Open page 50105, “Sample Services Access”, click “Edit List” to switch to edit mode:
- Fill out parameters needed to run sample actions:
- “Aad Client Id” – use “Application (client) ID” value from registered app
- “Aad Client Secret” – use “App Secret” value from registered app
- “Redirect Url” – use “Redirect Uri” value from registered app
- “Login Hint” – use UPN (Authentication email) of a user, which will acquire initial token. Normally this will be current user in Business Central.
- “Authority Url” – use
https://login.microsoftonline.com/<AAD TENANT ID>/oauth2
- Click “Actions” – “Acquire Initial Token”. This will open a dialog window “Waiting for a response” and a popup window to enter user credentials:
- When credentials are entered and verified, popup and dialog windows will close, and “Token” and “Cache” values will appear in “Initial Access Token + Token cache” section:
- Fill out scopes to access with On-Behalf flow, which were previously configured and consented to in the registered app, for example:
- For Graph:
https://graph.microsoft.com/User.Read
or justUser.Read
- For SharePoint:
https://microsoft.sharepoint-df.com/Files.ReadWrite.All
- For Business Central:
https://dynamics.microsoft.com/business-central/overview/Financials.ReadWrite.All
- For Graph:
- Click “Actions” – “Acquire On-Behalf Access Token”. Status on currently selected line will change to “Token Acquired”. You can do that for every line to acquire on-behalf tokens for all services.
- Now you can click “Actions” - “See Access Token for Scope” to see and inspect on-behalf access tokens: