Add provider registry support.
diff --git a/authenticate.go b/authenticate.go
index 19fabf6..754823c 100644
--- a/authenticate.go
+++ b/authenticate.go
@@ -1,13 +1,17 @@
package gophercloud
-import (
- "fmt"
-)
-
type AuthOptions struct {
Username, Password, TenantId string
}
-func Authenticate(provider string, options AuthOptions) (*int, error) {
- return nil, fmt.Errorf("Not implemented.")
+func (c *Context) Authenticate(provider string, options AuthOptions) (*int, error) {
+ _, err := c.ProviderByName(provider)
+ if err != nil {
+ return nil, err
+ }
+
+ if (options.Username == "") || (options.Password == "") {
+ return nil, ErrCredentials
+ }
+ return nil, nil
}