You are here

function oauth2_client_test_callback in OAuth2 Client 7

Same name and namespace in other branches
  1. 7.2 tests/oauth2_client_test.module \oauth2_client_test_callback()

Trying test clients.

Call them by opening in browser:

  • $base_url/oauth2/test/client-credentials
  • $base_url/oauth2/test/user-password
  • $base_url/oauth2/test/server-side
  • $base_url/oauth2/test/server-side-auto
  • $base_url/oauth2/test/wrong-client-id
  • $base_url/oauth2/test/wrong-client-secret
  • $base_url/oauth2/test/wrong-token-endpoint
  • $base_url/oauth2/test/wrong-auth-flow
  • $base_url/oauth2/test/wrong-username
  • $base_url/oauth2/test/wrong-password
  • $base_url/oauth2/test/wrong-scope
  • $base_url/oauth2/test/wrong-authorization-endpoint
  • $base_url/oauth2/test/wrong-redirect-uri
1 string reference to 'oauth2_client_test_callback'
oauth2_client_test_menu in tests/oauth2_client_test.module
Implements hook_menu().

File

tests/oauth2_client_test.module, line 173
Testing OAuth2 client functionality.

Code

function oauth2_client_test_callback($client_name) {
  try {

    // Get an access token and output it.
    $oauth2_client = oauth2_client_load($client_name);
    $access_token = $oauth2_client
      ->getAccessToken();
    print "access_token: {$access_token}";
  } catch (Exception $e) {
    print $e
      ->getMessage();
  }
}