Open kaustavha opened 8 years ago
Hi,
package main
import (
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/openstack"
"github.com/rackspace/gophercloud/openstack/identity/v2/tokens"
"fmt"
)
func main() {
var authOpts = gophercloud.AuthOptions{
IdentityEndpoint: "https://identity.api.rackspacecloud.com/v2.0",
Username: "cmdemo",
Password: "xxx",
}
var provider, _ = openstack.AuthenticatedClient(authOpts)
var client = openstack.NewIdentityV2(provider)
var opts = tokens.AuthOptions{
authOpts,
}
var token, _ = tokens.Create(client, opts).ExtractToken()
fmt.Println(token)
}
The example documentation on http://gophercloud.io/docs/identity/v2/ is out of date.
Example:
This results in the following sequence of errors: