Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type

Jaydeep Patel 0 Reputation points
2024-03-05T09:18:05.6066667+00:00

In our project, we currently utilize an Angular (frontend) - .NET (middle layer) - nvasion Business Dynamics API (backend) architecture. As part of an ongoing optimization effort, we are planning to eliminate the middle layer and directly invoke APIs from Angular to nvasion API. However, during this transition, I encountered an issue while attempting to make API calls directly from Angular to the nvasion API.

The specific problem arises when I attempt to access the authentication endpoint of the Business Dynamics API to obtain a token for API authentication purposes. The error message received is as follows: 'AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type. Request origin: '[http://localhost:3200]'. Trace ID: 62f44671-7ebe-4e00-bd29-de3db9f9c400 Correlation ID: 7c11dd26-f31e-48c0-ae40-80d8f8f26d60 Timestamp: 2024-03-05 06:29:09Z'.

Interestingly, when attempting the same request using Postman, a successful response is received. I have attached a screenshot of the successful response for reference.
2

1

Could you kindly provide an explanation of this error and suggest a solution to address it?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,253 questions
Windows 365 Business
{count} votes