diff --git a/oauth_common.install b/oauth_common.install index 1c92a21..d8b5c70 100644 --- a/oauth_common.install +++ b/oauth_common.install @@ -67,7 +67,7 @@ function oauth_common_schema() { 'consumer_key' => array( 'description' => t('Consumer key.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, ), 'provider_consumer' => array( @@ -81,7 +81,7 @@ function oauth_common_schema() { 'secret' => array( 'description' => t('Consumer secret.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, ), 'created' => array( @@ -141,7 +141,7 @@ function oauth_common_schema() { 'token_key' => array( 'description' => t('Token key.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, ), 'provider_token' => array( @@ -155,7 +155,7 @@ function oauth_common_schema() { 'secret' => array( 'description' => t('Token secret.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, ), 'created' => array( @@ -192,7 +192,7 @@ function oauth_common_schema() { 'consumer_key' => array( 'description' => t('Consumer key from {oauth_common_consumer}.consumer_key.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, ), 'services' => array( @@ -298,4 +298,12 @@ function oauth_common_update_6200() { function oauth_common_update_6201() { module_load_include('6201.inc', 'oauth_common', 'updates/update'); return _oauth_common_update_6201(); +} + +/** + * This update allows for longer consumer secrets. + */ +function oauth_common_update_6202() { + module_load_include('6202.inc', 'oauth_common', 'updates/update'); + return _oauth_common_update_6202(); } \ No newline at end of file diff --git a/oauth_common.module b/oauth_common.module index a9d893f..de91e3a 100644 --- a/oauth_common.module +++ b/oauth_common.module @@ -429,6 +429,7 @@ function oauth_common_get_request_token($consumer_token, $request_endpoint='/oau $client = new DrupalOAuthClient($consumer_token); $request_token = $client->getRequestToken($request_endpoint); $request_token->write(); + //TODO: Isn't the endpoint defined as the second argument? return $client->getAuthorizationUrl($authorize_endpoint); } diff --git a/updates/update.6202.inc b/updates/update.6202.inc new file mode 100644 index 0000000..02e0ea6 --- /dev/null +++ b/updates/update.6202.inc @@ -0,0 +1,46 @@ + t('Consumer key.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); + + db_change_field($ret, 'oauth_common_consumer', 'secret', 'secret', array( + 'description' => t('Consumer secret.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); + + db_change_field($ret, 'oauth_common_token', 'secret', 'secret', array( + 'description' => t('Consumer secret.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); + + db_change_field($ret, 'oauth_common_token', 'token_key', 'token_key', array( + 'description' => t('Token key.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); + + db_change_field($ret, 'oauth_common_token', 'consumer_key', 'consumer_key', array( + 'description' => t('Consumer key from {oauth_common_consumer}.consumer_key.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); + + return $ret; +} \ No newline at end of file