I face the above CORS policy error when an API call is made to the Yammer API search endpoint.
The issue is seen when User's AAD token is created for the scope:
The same app works when an token generated using Yammer/client application. But the app throws cors error when the token is generated using the AAD app.
I have followed the below process to generate access token for the user logged in:
- Created an app in the AAD app registration
- Added Yammer API as API Permission with Delegated User_Impersonation permission.
- Admin granted for whole organization to use this app to login.
- Use the client_ID in the MSAL library for Angular application to log user in and generate Yammer token.
- Token creation successful, The token works fine when used with postman.