mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-11 10:05:19 +02:00
[feature/oauth] Create means to associate phpBB account with external
PHPBB3-11673
This commit is contained in:
parent
469879716d
commit
fe9428b725
@ -923,7 +923,7 @@ function get_schema_struct()
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$schemda_data['auth_provider_oauth'] = array(
|
$schemda_data['auth_provider_oauth_token_storage'] = array(
|
||||||
'COLUMNS' => array(
|
'COLUMNS' => array(
|
||||||
'user_id' => array('UINT', 0), // phpbb_users.user_id
|
'user_id' => array('UINT', 0), // phpbb_users.user_id
|
||||||
'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
|
'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
|
||||||
@ -936,6 +936,18 @@ function get_schema_struct()
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$schemda_data['auth_provider_oauth_account_assoc'] = array(
|
||||||
|
'COLUMNS' => array(
|
||||||
|
'user_id' => array('UINT', 0),
|
||||||
|
'oauth_provider' => array('VCHAR'),
|
||||||
|
'oauth_provider_id' => array('TEXT_UNI'),
|
||||||
|
),
|
||||||
|
'PRIMARY_KEY' => array(
|
||||||
|
'user_id',
|
||||||
|
'oauth_provider',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
$schema_data['phpbb_banlist'] = array(
|
$schema_data['phpbb_banlist'] = array(
|
||||||
'COLUMNS' => array(
|
'COLUMNS' => array(
|
||||||
'ban_id' => array('UINT', NULL, 'auto_increment'),
|
'ban_id' => array('UINT', NULL, 'auto_increment'),
|
||||||
|
@ -76,6 +76,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
|
|||||||
// Send a request with it
|
// Send a request with it
|
||||||
$result = json_decode( $this->service_provider->request('user/info'), true );
|
$result = json_decode( $this->service_provider->request('user/info'), true );
|
||||||
|
|
||||||
// Get the user id
|
// Return the unique identifier returned from bitly
|
||||||
|
return $result['data']['login'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,8 @@ interface phpbb_auth_provider_oauth_service_interface
|
|||||||
/**
|
/**
|
||||||
* Returns the results of the authentication in json format
|
* Returns the results of the authentication in json format
|
||||||
*
|
*
|
||||||
* @return type The results of the authentication action in json format.
|
* @return string The unique identifier returned by the service provider
|
||||||
|
* that is used to authenticate the user with phpBB.
|
||||||
*/
|
*/
|
||||||
public function perform_auth_login();
|
public function perform_auth_login();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'add_tables' => array(
|
'add_tables' => array(
|
||||||
$this->table_prefix . 'auth_provider_oauth' => array(
|
$this->table_prefix . 'auth_provider_oauth_token_storage' => array(
|
||||||
'COLUMNS' => array(
|
'COLUMNS' => array(
|
||||||
'user_id' => array('UINT', 0), // phpbb_users.user_id
|
'user_id' => array('UINT', 0), // phpbb_users.user_id
|
||||||
'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
|
'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
|
||||||
@ -30,6 +30,17 @@ class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration
|
|||||||
'oauth_provider' => array('INDEX', 'oauth_provider'),
|
'oauth_provider' => array('INDEX', 'oauth_provider'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
$this->table_prefix . 'auth_provider_oauth_account_assoc' => array(
|
||||||
|
'COLUMNS' => array(
|
||||||
|
'user_id' => array('UINT', 0),
|
||||||
|
'oauth_provider' => array('VCHAR'),
|
||||||
|
'oauth_provider_id' => array('TEXT_UNI'),
|
||||||
|
),
|
||||||
|
'PRIMARY_KEY' => array(
|
||||||
|
'user_id',
|
||||||
|
'oauth_provider',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user