Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用伦敦帐户使用openstack.net API云文件进行身份验证_C#_Openstack_Rackspace Cloud - Fatal编程技术网

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

C# 使用伦敦帐户使用openstack.net API云文件进行身份验证,c#,openstack,rackspace-cloud,C#,Openstack,Rackspace Cloud,当我使用: CloudIdentity identity = new CloudIdentity() { Username = "files.user", APIKey = "pswd", }; var _storage = new CloudFilesProvider(identity); 身份验证失败。我认为

当我使用:

            CloudIdentity identity =
            new CloudIdentity()
            {
                Username = "files.user",
                APIKey = "pswd",
            };
            var _storage = new CloudFilesProvider(identity);
身份验证失败。我认为问题在于我有一个LON帐户,默认的身份验证目标是US cloud实例。在openstack.NETWiki上,我看到了下面的示例

IIdentityProvider identityProvider = new CloudIdentityProvider();
var userAccess = identityProvider.Authenticate(new RackspaceCloudIdentity{
                                                    Username = "MyUserName", 
                                                    Password = "MyPassword", 
                                                    CloudInstance =CloudInstance.UK});
在最新版本的库中,RackspaceCloudIdentity具有域参数,而不是CloudInstance。我想这个例子已经过时了


如何使用域参数?还是有更好的方法通过LON cloud实例进行身份验证?

Rackspace现在使用全局身份验证,因此美国和英国帐户之间的唯一区别是您传入的凭据。如果身份验证失败,则可能出现以下问题之一:

  • CloudIdentity
    实例的用户名和/或API密钥不正确
  • 身份服务在您尝试进行身份验证的特定时刻经历了某种中断
  • 身份验证正在成功,但发生了另一个错误,您将其归因于身份验证失败(您没有提供任何异常详细信息,因此我不能排除这种可能性)

  • 我也看到了同样的错误。我相信这与通过UI创建的子帐户有关。他们没有正确设置DefaultRegion(为空)


    解决此问题的唯一方法是使用父帐户,或者在每次API调用时手动设置区域。

    Hi。我发现了问题。这是关于我使用的用户帐户。我创建这个帐户只是为了访问云文件。我可以在用户管理面板上看到,该用户有权“查看、创建、编辑、删除”产品“文件”。但是,当我尝试在代码中验证该用户时,会出现以下异常:“该用户无权访问请求的服务或区域”。我在我的主要用户身上尝试了相同的代码,而且效果很好。有什么建议吗?