Which Microsoft API is utilized in while consuming function acquireTokenOnBehalfOf of SDK "@azure/msal-node"?

Suraj Sinha 5 Reputation points
2024-12-06T05:43:18.9066667+00:00

We are building a web-based, JavaScript Outlook Add-In which is required to call Microsoft Graph APIs to access the Outlook's user's emails and attachments.

The authentication process is being implemented using Single Sign-On (SSO) as outlined in the Microsoft documentation below:

Documentation Link
User's image

I am working on integrating the @azure/msal-node SDK into my application to write server-side code, specifically using the ConfidentialClientApplication class to implement the OAuth 2.0 On-Behalf-Of (OBO) flow. My goal is to acquire an access token (let's call it Token B) for accessing downstream APIs like Microsoft Graph by exchanging an existing token (Token A) from client-side code.

My Setup

NodeJS version: 20.12.2

SDK: @azure/msal-node

Class Used: msal.ConfidentialClientApplication

Function: acquireTokenOnBehalfOf

Questions:

  1. What Microsoft API is utilized internally by the acquireTokenOnBehalfOf method to fetch the token B?
  2. Is there any specific resources or documentation links that provide further insights into the OBO flow which helps me getting the Microsoft API used in "acquireTokenOnBehalfOf()" function?
Outlook
Outlook
A family of Microsoft email and calendar products.
4,218 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,653 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,103 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,363 questions
Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
2,214 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Suraj Sinha 5 Reputation points
    2024-12-09T10:34:16.81+00:00

    Hi Microsoft Team,

    We found that the acquireTokenOnBehalfOf() function internally uses the following API endpoint: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token

    This information is referenced in the Microsoft documentation linked below: On-behalf-of flow example

    Could you please confirm if this reference is accurate or not?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.