Reputation: 11
I am building a SPFX SharePoint online webpart using the Mendeley Javascript SDK and trying the Client Credentials Flow authorization. I get the CORS error: Access to XMLHttpRequest at 'https://api.mendeley.com/oauth/token' from origin 'https://xyz.sharepoint.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. */
private clientCredentialsFlow() {
var sdk = mendeley;
var api = sdk({
authFlow: sdk.Auth.clientCredentialsFlow({
clientId: 1234,
clientSecret: 'abcdefghijk',
redirectUri: 'https://xyz.sharepoint.com/_layouts/15/workbench.aspx'
})
});
Upvotes: 1
Views: 39