function oauth2_server_services_security_settings in OAuth2 Server 7
Services authentication "security_settings" callback.
1 string reference to 'oauth2_server_services_security_settings'
- oauth2_server_services_authentication_info in ./
oauth2_server.module - Implements hook_services_authentication().
File
- includes/
oauth2_server.services_auth.inc, line 49 - Provides an authentication method to Services.
Code
function oauth2_server_services_security_settings($settings, &$form_state) {
if (isset($form_state['values']['oauth2']['server'])) {
$settings['server'] = $form_state['values']['oauth2']['server'];
}
$options = array(
'' => t('- Select -'),
);
$servers = entity_load('oauth2_server');
foreach ($servers as $server) {
$options[$server->name] = $server->label;
}
$form = array();
$form['server'] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => isset($settings['server']) ? $settings['server'] : '',
'#title' => t('OAuth2 server'),
'#required' => TRUE,
);
return $form;
}