[英]Authenticating with openstack.net API cloud files using London account
當我使用時:
CloudIdentity identity =
new CloudIdentity()
{
Username = "files.user",
APIKey = "pswd",
};
var _storage = new CloudFilesProvider(identity);
身份驗證失敗。 我發現問題是我有一個LON帳戶,默認身份驗證目標是美國雲實例。 在openstack.net Wiki上,我看到了以下示例。
IIdentityProvider identityProvider = new CloudIdentityProvider();
var userAccess = identityProvider.Authenticate(new RackspaceCloudIdentity{
Username = "MyUserName",
Password = "MyPassword",
CloudInstance =CloudInstance.UK});
在該庫的最新版本中,RackspaceCloudIdentity具有Domain參數而不是CloudInstance。 我想這個例子已經過時了。
如何使用Domain參數? 還是有更好的方法來驗證LON雲實例?
Rackspace現在使用全局身份驗證,因此美國帳戶和英國帳戶之間的唯一區別是您傳遞的憑據。如果身份驗證失敗,則可能是以下問題之一:
CloudIdentity
實例的用戶名和/或API密鑰不正確。 我一直看到相同的錯誤。 我認為這與通過UI創建的子帳戶有關。 它們沒有正確設置DefaultRegion(它為null)。
解決此問題的唯一方法是使用父帳戶,或者在每個API調用上手動設置區域。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.