Get 404 error while making Microsoft Graph Api call in SSO feature after deployment

Harit Pant 1 Reputation point
2021-08-16T07:19:58.703+00:00

I am developing the office Add-in using "Yeoman generator for Office Add-ins", selecting " Office Add-in Task Pane project supporting single sign-on" option.

After that I register the application in Azure AD for SSO functionality. On localhost SSO works fine.

When I deploy the application on Azure/Heroku server and run the application it works fine but when user verifies the SSO consent I get success token and pass it to makeGraphApiCall() method as a parameter and get “404 (The requested content does not exist.)” error on URL : GET /getuserdata?_=1629095448192

Mention in fallbackauthhelper.ts file as attached, this file is generated as boilerplate for SSO purpose using Yeoman generator for Office Add-ins.

123514-fallbackauthhelper.txt
const response = await sso.makeGraphApiCall(messageFromDialog.result);

Request we send on above URL:
Accept: /
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
access_token: token removed as security
Connection: keep-alive
Host: XYZ.z13.web.core.windows.net
Referer: https://XYZ.z13.web.core.windows.net/taskpane.html?et=
sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
sec-ch-ua-mobile: ?0
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
X-Requested-With: XMLHttpRequest

Response we get on above URL:
Content-Length: 321
Content-Type: text/html
Date: Mon, 16 Aug 2021 06:31:05 GMT
Server: Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0
x-ms-error-code: WebContentNotFound
x-ms-request-id: e2a366b9-201e-0075-1268-92b983000000
x-ms-version: 2018-03-28

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.
3,479 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,447 questions
{count} votes