diff --git a/oauth2_server.module b/oauth2_server.module
index dfcfda7..e53be5f 100644
--- a/oauth2_server.module
+++ b/oauth2_server.module
@@ -240,14 +240,7 @@ function oauth2_server_entity_info() {
       'id' => 'token_id',
       'bundle' => 'type',
     ),
-    'bundles' => array(
-      'access' => array(
-        'label' => t('Access token'),
-      ),
-      'refresh' => array(
-        'label' => t('Refresh token')
-      ),
-    ),
+    'bundles' => oauth2_server_token_bundles(),
     'module' => 'oauth2_server',
     'metadata controller class' => 'OAuth2ServerTokenMetadataController',
     'views controller class' => 'EntityDefaultViewsController',
@@ -271,6 +264,25 @@ function oauth2_server_entity_info() {
 }
 
 /**
+ * Define the available token bundles.
+ *
+ * @return array
+ *   An array as expected by the 'bundles' key in hook_entity_info().
+ */
+function oauth2_server_token_bundles() {
+  $bundles = array(
+    'access' => array(
+      'label' => t('Access token'),
+    ),
+    'refresh' => array(
+      'label' => t('Refresh token')
+    ),
+  );
+  drupal_alter(__FUNCTION__, $bundles);
+  return $bundles;
+}
+
+/**
  * Implements hook_flush_caches().
  */
 function oauth2_server_flush_caches() {
@@ -293,7 +305,7 @@ function oauth2_server_flush_caches() {
   // Go over all bundles that should have an instance of the scopes field,
   // and create the instance where missing.
   $needed_instances = array(
-    'oauth2_server_token' => array('access', 'refresh'),
+    'oauth2_server_token' => array_keys(oauth2_server_token_bundles()),
     'oauth2_server_authorization_code' => array('oauth2_server_authorization_code'),
   );
   foreach ($needed_instances as $entity_type => $bundles) {
