phpBB API Documentation
Class

phpbb\auth\provider\oauth\oauth

class oauth extends base

OAuth authentication provider for phpBB3

Methods

boolean|string init()

Checks whether the user is currently identified to the authentication provider.

array|null autologin()

Autologin function

from base
acp()

This function is used to output any required fields in the authentication admin panel.

get_acp_template($new_config)

This function updates the template with variables related to the acp options with whatever configuraton values are passed to it as an array.

get_login_data()

Returns an array of data necessary to build custom elements on the login form.

get_auth_link_data(int $user_id)

Returns an array of data necessary to build the ucpauthlink page

logout(array $data, boolean $new_session)

Performs additional actions during logout.

boolean validate_session(array $user)

The session validation function checks whether the user is still logged into phpBB.

from base
login_link_has_necessary_data($login_link_data)

Checks to see if $loginlinkdata contains all information except for the user_id of an account needed to successfully link an external account to a forum account.

link_account(array $link_data)

Links an external account to a phpBB account.

unlink_account(array $link_data)

Unlinks an external account from a phpBB account.

__construct(driver_interface $db, config $config, manager $passwords_manager, request_interface $request, user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_state_table, $auth_provider_oauth_token_account_assoc, service_collection $service_providers, $users_table, ContainerInterface $phpbb_container, dispatcher_interface $dispatcher, $phpbb_root_path, $php_ext)

OAuth Authentication Constructor

login($username, $password)

Performs login.

Details

at line 167
public boolean|string init()

Checks whether the user is currently identified to the authentication provider.

Called in acpboard while setting authentication plugins. Changing to an authentication provider will not be permitted in acpboard if there is an error.

Return Value

boolean|string False if the user is identified, otherwise an error message, or null if not implemented.

in base at line 32
public array|null autologin()

Autologin function

Return Value

array|null containing the user row, empty if no auto login should take place, or null if not impletmented.

at line 393
public acp()

This function is used to output any required fields in the authentication admin panel.

It also defines any required configuration table fields.

at line 410
public get_acp_template($new_config)

This function updates the template with variables related to the acp options with whatever configuraton values are passed to it as an array.

It then returns the name of the acp file related to this authentication provider.

Parameters

$new_config

at line 364
public get_login_data()

Returns an array of data necessary to build custom elements on the login form.

Returns an array of data necessary to build the ucpauthlink page

Parameters

int $user_id User ID for whom the data should be retrieved. defaults to 0, which is not a valid ID. The method should fall back to the current user's ID in this case.

at line 610
public logout(array $data, boolean $new_session)

Performs additional actions during logout.

Parameters

array $data An array corresponding to \phpbb\session::data
boolean $new_session True for a new session, false for no new session.

in base at line 80
public boolean validate_session(array $user)

The session validation function checks whether the user is still logged into phpBB.

Parameters

array $user

Return Value

boolean true if the given user is authenticated, false if the session should be closed, or null if not implemented.

Checks to see if $loginlinkdata contains all information except for the user_id of an account needed to successfully link an external account to a forum account.

Parameters

$login_link_data

Links an external account to a phpBB account.

Parameters

array $link_data

Unlinks an external account from a phpBB account.

Parameters

array $link_data

at line 146
public __construct(driver_interface $db, config $config, manager $passwords_manager, request_interface $request, user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_state_table, $auth_provider_oauth_token_account_assoc, service_collection $service_providers, $users_table, ContainerInterface $phpbb_container, dispatcher_interface $dispatcher, $phpbb_root_path, $php_ext)

OAuth Authentication Constructor

Parameters

driver_interface $db
config $config
manager $passwords_manager
request_interface $request
user $user
$auth_provider_oauth_token_storage_table
$auth_provider_oauth_state_table
$auth_provider_oauth_token_account_assoc
service_collection $service_providers
$users_table
ContainerInterface $phpbb_container
dispatcher_interface $dispatcher
$phpbb_root_path
$php_ext

at line 185
public login($username, $password)

Performs login.

Parameters

$username
$password