簡體   English   中英

使用倫敦帳戶通過openstack.net API雲文件進行身份驗證

[英]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現在使用全局身份驗證,因此美國帳戶和英國帳戶之間的唯一區別是您傳遞的憑據。如果身份驗證失敗,則可能是以下問題之一:

  1. 您的CloudIdentity實例的用戶名和/或API密鑰不正確。
  2. 在您嘗試進行身份驗證的特定時刻,身份服務遇到了某種故障。
  3. 身份驗證成功,但是又發生了另一個錯誤,您將其歸因於身份驗證失敗(您未提供任何異常詳細信息,所以我不能排除此錯誤)。

我一直看到相同的錯誤。 我認為這與通過UI創建的子帳戶有關。 它們沒有正確設置DefaultRegion(它為null)。

解決此問題的唯一方法是使用父帳戶,或者在每個API調用上手動設置區域。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM