简体   繁体   中英

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. On openstack.net wiki, I saw the below example.

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. I guess the example is out dated.

How do I use the Domain parameter? Or is there a better way to authenticate with LON cloud instance?

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:

  1. Your username and/or API key for the CloudIdentity instance are not correct.
  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. They do not have a DefaultRegion correctly set (it is null).

The only way around this is to use the parent account, or alternatively to manually set the region on every API call.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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