2 Package tokens provides information and interaction with the token API
3 resource for the OpenStack Identity service.
5 For more information, see:
6 http://developer.openstack.org/api-ref-identity-v3.html#tokens-v3
8 Example to Create a Token From a Username and Password
10 authOptions := tokens.AuthOptions{
15 token, err := tokens.Create(identityClient, authOptions).ExtractToken()
20 Example to Create a Token From a Username, Password, and Domain
22 authOptions := tokens.AuthOptions{
28 token, err := tokens.Create(identityClient, authOptions).ExtractToken()
33 authOptions = tokens.AuthOptions{
36 DomainName: "default",
39 token, err = tokens.Create(identityClient, authOptions).ExtractToken()
44 Example to Create a Token From a Token
46 authOptions := tokens.AuthOptions{
50 token, err := tokens.Create(identityClient, authOptions).ExtractToken()
55 Example to Create a Token from a Username and Password with Project ID Scope
57 scope := tokens.Scope{
58 ProjectID: "0fe36e73809d46aeae6705c39077b1b3",
61 authOptions := tokens.AuthOptions{
67 token, err = tokens.Create(identityClient, authOptions).ExtractToken()
72 Example to Create a Token from a Username and Password with Domain ID Scope
74 scope := tokens.Scope{
78 authOptions := tokens.AuthOptions{
84 token, err = tokens.Create(identityClient, authOptions).ExtractToken()
89 Example to Create a Token from a Username and Password with Project Name Scope
91 scope := tokens.Scope{
92 ProjectName: "project_name",
96 authOptions := tokens.AuthOptions{
102 token, err = tokens.Create(identityClient, authOptions).ExtractToken()