Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.MD

Introduction to OAuth2 Flows

This extension is an example on how to use all the OAuth 2.0 protocol authentication flows exposed by Microsoft Dynamics 365 Business Central.

OAuth 2.0 authentication protocol is supported by Business Central and can be used by internal and external AL developers. The functionality has been exposed as part of Microsoft AL application foundation System Module and exposes procedures that support and implement the OAuth 2.0 Authorization Code Flow, Client Credentials flow and On-Behalf-Of flow.

As a prerequisite for testing the functionality of this extension, the user must register an application with the Microsoft identity platform, making sure that they define the correct Redirect URI, such as https://businesscentral.dynamics.com/OAuthLanding.htm, and a client secret. Going forward, the user must configure the client application to access web APIs. For the sample extension, the required permissions are Microsoft Graph User.Read Delegated permissions and User.Read.All Application permissions.

After the extension has been published, the setup section parameters must be completed for the various flows to succeed. The values for all the parameters in this section are the ones defined or auto-generated in the Azure Active Directory application, except for the User Email, which must be filled in with the current user's email address.

Disclaimer

Microsoft Corporation ("Microsoft") grants you a nonexclusive, perpetual, royalty-free right to use and modify the software code provided by us for the purposes of illustration ("Sample Code") and to reproduce and distribute the object code form of the Sample Code, provided that you agree: (i) to not use our name, logo, or trademarks to market your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend us and our suppliers from and against any claims or lawsuits, whether in an action of contract, tort or otherwise, including attorneys' fees, that arise or result from the use or distribution of the Sample Code or the use or other dealings in the Sample Code. Unless applicable law gives you more rights, Microsoft reserves all other rights not expressly granted herein, whether by implication, estoppel or otherwise.

THE SAMPLE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MICROSOFT OR ITS LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.