我一直在使用MSAL Microsoft.Identity.Client.ConfidentialClientApplication
来执行仅限应用的Microsoft图表 - 群组操作。
var RedirectUri = "urn:ietf:wg:oauth:2.0:oob";
var clientApplication = new ConfidentialClientApplication(ClientId, RedirectUri, new ClientCredential(ClientSecret), null);
我坚持下一步:
authenticationResult = clientApplication.AcquireTokenSilentAsync(new string[]{"Group.ReadWrite.All"}).GetAwaiter().GetResult();
我收到错误failed_to_acquire_token_silently
。
authenticationResult = clientApplication.AcquireTokenForClient(new string[]{"Group.ReadWrite.All"}, string.Empty).GetAwaiter().GetResult();
我收到错误invalid_scope
。
不确定我应该继续朝哪个方向发展。
注意:
PublicClientApplication
相同的代码可以正常使用Group.ReadWrite.All
和委派Group.ReadWrite.All
权限PublicClienApplication
有一个不需要的用户界面对话框...... var clientApplication = new PublicClientApplication(ClientId);
authenticationResult = clientApplication.AcquireTokenAsync(Scopes).GetAwaiter().GetResult();
答案 0 :(得分:1)
请尝试同意您创建的自信客户。 您可以通过使用您的设置修改以下网址来执行此操作:
$my_aws_key = $config->amazon->s3->key;
$my_aws_secret_key = $config->amazon->s3->secret;
//amazon.s3.bucket
$bucket = $config->amazon->s3->bucket;
$s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
$status = $s3->putObject("{$bucket}/{$this->_envCode}/{$filePath}", $content,
array(Zend_Service_Amazon_S3::S3_ACL_HEADER =>
Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ));
if($status == true) {
return "{$this->_envCode}/{$filePath}";
}
确保您放入该网址的信息是机密客户端。
我希望这有帮助!