diff --git a/openstack/identity/v2/extensions/delegate.go b/openstack/identity/v2/extensions/delegate.go
index d08e1fd..1992a2c 100644
--- a/openstack/identity/v2/extensions/delegate.go
+++ b/openstack/identity/v2/extensions/delegate.go
@@ -1,6 +1,7 @@
 package extensions
 
 import (
+	"github.com/mitchellh/mapstructure"
 	"github.com/rackspace/gophercloud"
 	common "github.com/rackspace/gophercloud/openstack/common/extensions"
 	"github.com/rackspace/gophercloud/pagination"
@@ -16,17 +17,58 @@
 	common.GetResult
 }
 
-// ExtractExtensions interprets a Page as a slice of Extensions.
+// ExtensionPage is a single page of Extension results.
+type ExtensionPage struct {
+	common.ExtensionPage
+}
+
+// IsEmpty returns true if the current page contains at least one Extension.
+func (page ExtensionPage) IsEmpty() (bool, error) {
+	is, err := ExtractExtensions(page)
+	if err != nil {
+		return true, err
+	}
+	return len(is) == 0, nil
+}
+
+// ExtractExtensions accepts a Page struct, specifically an ExtensionPage struct, and extracts the
+// elements into a slice of Extension structs.
 func ExtractExtensions(page pagination.Page) ([]Extension, error) {
-	inner, err := common.ExtractExtensions(page)
+	// Identity v2 adds an intermediate "values" object.
+
+	type extension struct {
+		Updated     string        `mapstructure:"updated"`
+		Name        string        `mapstructure:"name"`
+		Namespace   string        `mapstructure:"namespace"`
+		Alias       string        `mapstructure:"alias"`
+		Description string        `mapstructure:"description"`
+		Links       []interface{} `mapstructure:"links"`
+	}
+
+	var resp struct {
+		Extensions struct {
+			Values []extension `mapstructure:"values"`
+		} `mapstructure:"extensions"`
+	}
+
+	err := mapstructure.Decode(page.(ExtensionPage).Body, &resp)
 	if err != nil {
 		return nil, err
 	}
-	outer := make([]Extension, len(inner))
-	for index, ext := range inner {
-		outer[index] = Extension{ext}
+
+	exts := make([]Extension, len(resp.Extensions.Values))
+	for i, original := range resp.Extensions.Values {
+		exts[i] = Extension{common.Extension{
+			Updated:     original.Updated,
+			Name:        original.Name,
+			Namespace:   original.Namespace,
+			Alias:       original.Alias,
+			Description: original.Description,
+			Links:       original.Links,
+		}}
 	}
-	return outer, nil
+
+	return exts, err
 }
 
 // Get retrieves information for a specific extension using its alias.
@@ -37,5 +79,7 @@
 // List returns a Pager which allows you to iterate over the full collection of extensions.
 // It does not accept query parameters.
 func List(c *gophercloud.ServiceClient) pagination.Pager {
-	return common.List(c)
+	return pagination.NewPager(c, common.ListExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
+		return ExtensionPage{common.ExtensionPage{SinglePageBase: pagination.SinglePageBase(r)}}
+	})
 }
diff --git a/openstack/identity/v2/extensions/delegate_test.go b/openstack/identity/v2/extensions/delegate_test.go
index 5cc7c12..90eb21b 100644
--- a/openstack/identity/v2/extensions/delegate_test.go
+++ b/openstack/identity/v2/extensions/delegate_test.go
@@ -26,7 +26,7 @@
 	th.SetupHTTP()
 	defer th.TeardownHTTP()
 
-	th.Mux.HandleFunc("/v2.0/extensions", func(w http.ResponseWriter, r *http.Request) {
+	th.Mux.HandleFunc("/extensions", func(w http.ResponseWriter, r *http.Request) {
 		th.TestMethod(t, r, "GET")
 		th.TestHeader(t, r, "X-Auth-Token", TokenID)
 
@@ -34,28 +34,28 @@
 
 		fmt.Fprintf(w, `
 {
-    "extensions": [
-        {
-            "updated": "2013-01-20T00:00:00-00:00",
-            "name": "Neutron Service Type Management",
-            "links": [],
-            "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0",
-            "alias": "service-type",
-            "description": "API for retrieving service providers for Neutron advanced services"
-        }
-    ]
+	"extensions": {
+		"values": [
+			{
+				"updated": "2013-01-20T00:00:00-00:00",
+				"name": "Neutron Service Type Management",
+				"links": [],
+				"namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0",
+				"alias": "service-type",
+				"description": "API for retrieving service providers for Neutron advanced services"
+			}
+		]
+	}
 }
-      `)
+		`)
 	})
 
 	count := 0
 
-	List(ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+	err := List(ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
 		count++
 		actual, err := ExtractExtensions(page)
-		if err != nil {
-			t.Errorf("Failed to extract extensions: %v", err)
-		}
+		th.AssertNoErr(t, err)
 
 		expected := []Extension{
 			Extension{
@@ -74,17 +74,15 @@
 
 		return true, nil
 	})
-
-	if count != 1 {
-		t.Errorf("Expected 1 page, got %d", count)
-	}
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, 1, count)
 }
 
 func TestGet(t *testing.T) {
 	th.SetupHTTP()
 	defer th.TeardownHTTP()
 
-	th.Mux.HandleFunc("/v2.0/extensions/agent", func(w http.ResponseWriter, r *http.Request) {
+	th.Mux.HandleFunc("/extensions/agent", func(w http.ResponseWriter, r *http.Request) {
 		th.TestMethod(t, r, "GET")
 		th.TestHeader(t, r, "X-Auth-Token", TokenID)
 
