我正在使用Mendeley Javascript SDK构建SPFX SharePoint联机Web部件,并尝试客户端证书流授权。我收到CORS错误: 从源“ https://api.mendeley.com/oauth/token”对“ https://xyz.sharepoint.com”处XMLHttpRequest的访问已被CORS策略阻止:请求的资源上不存在“ Access-Control-Allow-Origin”标头。 * /
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'
})
});