You are here

function oauth2_server_refresh_token_settings in OAuth2 Server 7

Provides a settings form for the refresh_token grant type.

1 string reference to 'oauth2_server_refresh_token_settings'
oauth2_server_grant_types in ./oauth2_server.module
Returns an array of supported grant types and related data.

File

./oauth2_server.module, line 1164
Provides OAuth2 server functionality.

Code

function oauth2_server_refresh_token_settings($config, $dom_ids = array()) {
  $form = array();
  $form['always_issue_new_refresh_token'] = array(
    '#type' => 'checkbox',
    '#title' => t('Always issue a new refresh token after the existing one has been used'),
    '#default_value' => $config['always_issue_new_refresh_token'],
  );
  $form['unset_refresh_token_after_use'] = array(
    '#type' => 'checkbox',
    '#title' => t('Unset (delete) the refresh token after it has been used'),
    '#default_value' => $config['unset_refresh_token_after_use'],
  );
  foreach ($dom_ids as $dom_id) {
    $form['always_issue_new_refresh_token']['#states']['visible']['#' . $dom_id]['checked'] = TRUE;
    $form['unset_refresh_token_after_use']['#states']['visible']['#' . $dom_id]['checked'] = TRUE;
  }
  return $form;
}