You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Carolyn Van Slyck edited this page Jan 4, 2016
·
1 revision
Below is an example of how to connect and authenticate to any OpenStack provider. At the moment we only support identity v2, so make sure to use the right endpoint.
Prerequisites
Install the openstack.net NuGet package.
Example
Below is a .NET Console Application. Replace {user-name}, {password}, {project-name} and {identity-url} with your credentials.
usingSystem;usingnet.openstack.Core.Domain;usingnet.openstack.Core.Providers;usingnet.openstack.Providers.Rackspace;namespaceMyApplication{classProgram{staticvoidMain(string[]args){varidentityEndpoint=newUri("{identity-url}");varidentity=newCloudIdentityWithProject{Username="{user-name}",Password="{password}",ProjectName="{project-name}"};varidentityProvider=newOpenStackIdentityProvider(identityEndpoint,identity);// Verify that we can connect and our credentials are correctidentityProvider.Authenticate();// Now that we know we can connect, use the identity with another servicevarserverProvider=newCloudServersProvider(identity);serverProvider.ListFlavors();}}}