简体   繁体   English

使用伦敦帐户通过openstack.net API云文件进行身份验证

[英]Authenticating with openstack.net API cloud files using London account

When I use: 当我使用时:

            CloudIdentity identity =
            new CloudIdentity()
            {
                Username = "files.user",
                APIKey = "pswd",
            };
            var _storage = new CloudFilesProvider(identity);

Authentication fails. 身份验证失败。 I figured that the problem is that I have a LON account and the default authentication target is US cloud instance. 我发现问题是我有一个LON帐户,默认身份验证目标是美国云实例。 On openstack.net wiki, I saw the below example. 在openstack.net Wiki上,我看到了以下示例。

IIdentityProvider identityProvider = new CloudIdentityProvider();
var userAccess = identityProvider.Authenticate(new RackspaceCloudIdentity{
                                                    Username = "MyUserName", 
                                                    Password = "MyPassword", 
                                                    CloudInstance =CloudInstance.UK});

In the latest version of the library, RackspaceCloudIdentity has Domain parameter instead of CloudInstance. 在该库的最新版本中,RackspaceCloudIdentity具有Domain参数而不是CloudInstance。 I guess the example is out dated. 我想这个例子已经过时了。

How do I use the Domain parameter? 如何使用Domain参数? Or is there a better way to authenticate with LON cloud instance? 还是有更好的方法来验证LON云实例?

Rackspace uses global authentication now, so the only difference between the US and UK accounts is the credentials you pass in. If authentication is failing then one of the following is the likely issue: Rackspace现在使用全局身份验证,因此美国帐户和英国帐户之间的唯一区别是您传递的凭据。如果身份验证失败,则可能是以下问题之一:

  1. Your username and/or API key for the CloudIdentity instance are not correct. 您的CloudIdentity实例的用户名和/或API密钥不正确。
  2. The identity service experienced an outage of some sort at the particular moment you tried to authenticate. 在您尝试进行身份验证的特定时刻,身份服务遇到了某种故障。
  3. Authentication is succeeding, but another error occurred which you have attributed to failed authentication (you didn't provide any exception details so I can't rule this out). 身份验证成功,但是又发生了另一个错误,您将其归因于身份验证失败(您未提供任何异常详细信息,所以我不能排除此错误)。

I have been seeing the same error. 我一直看到相同的错误。 I believe that it is something to do with child accounts created via the UI. 我认为这与通过UI创建的子帐户有关。 They do not have a DefaultRegion correctly set (it is null). 它们没有正确设置DefaultRegion(它为null)。

The only way around this is to use the parent account, or alternatively to manually set the region on every API call. 解决此问题的唯一方法是使用父帐户,或者在每个API调用上手动设置区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM