Expose auth with a tenantName
The Identity API allows specification of the TenantName instead of TenantId,
and that is much more convenient for customer-facing stuff.
diff --git a/authenticate.go b/authenticate.go
index 52bc1ab..886a6fa 100644
--- a/authenticate.go
+++ b/authenticate.go
@@ -17,6 +17,9 @@
// The TenantId field is optional for the Identity V2 API.
TenantId string
+ // The TenantName can be specified instead of the TenantId
+ TenantName string
+
// AllowReauth should be set to true if you grant permission for Gophercloud to cache
// your credentials in memory, and to allow Gophercloud to attempt to re-authenticate
// automatically if/when your token expires. If you set it to false, it will not cache
@@ -36,6 +39,7 @@
type Auth struct {
PasswordCredentials PasswordCredentials `json:"passwordCredentials"`
TenantId string `json:"tenantId,omitempty"`
+ TenantName string `json:"tenantName,omitempty"`
}
// PasswordCredentials provides a JSON encoding wrapper for passing credentials to the Identity
@@ -114,7 +118,8 @@
Username: options.Username,
Password: options.Password,
},
- TenantId: options.TenantId,
+ TenantId: options.TenantId,
+ TenantName: options.TenantName,
},
},
Results: &struct {