我正在尝试从Ionic + Angular应用程序访问共享点,并收到以下消息: 我写的代码是:
getSharepointAuth(){
var url='https://accounts.accesscontrol.windows.net/2fafb8a9-d1df-44b0-b73c-f04a956b05ba/tokens/OAuth/2?access_token';
var form:any={
'grant_type': 'client_credentials',
'client_id': appReg_clientId@realm,
'client_secret':appReg_clientSecret,
'resource': principle/targetHost@realm,
'appReg_bearerToken':''
};
let body = new URLSearchParams(form).toString();
var reqHeader = new HttpHeaders().set('content-type', 'application/x-www-form-urlencoded')
return this.http.post(url,body, {headers:reqHeader,withCredentials:true});
}
我的sharepoint应用已在azure上注册,我正在使用客户端ID并从那里进行保密。