ClientCredentialsInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace OAuth2\Storage;
  3. /**
  4. * Implement this interface to specify how the OAuth2 Server
  5. * should verify client credentials
  6. *
  7. * @author Brent Shaffer <bshafs at gmail dot com>
  8. */
  9. interface ClientCredentialsInterface extends ClientInterface
  10. {
  11. /**
  12. * Make sure that the client credentials is valid.
  13. *
  14. * @param $client_id
  15. * Client identifier to be check with.
  16. * @param $client_secret
  17. * (optional) If a secret is required, check that they've given the right one.
  18. *
  19. * @return
  20. * TRUE if the client credentials are valid, and MUST return FALSE if it isn't.
  21. * @endcode
  22. *
  23. * @see http://tools.ietf.org/html/rfc6749#section-3.1
  24. *
  25. * @ingroup oauth2_section_3
  26. */
  27. public function checkClientCredentials($client_id, $client_secret = null);
  28. /**
  29. * Determine if the client is a "public" client, and therefore
  30. * does not require passing credentials for certain grant types
  31. *
  32. * @param $client_id
  33. * Client identifier to be check with.
  34. *
  35. * @return
  36. * TRUE if the client is public, and FALSE if it isn't.
  37. * @endcode
  38. *
  39. * @see http://tools.ietf.org/html/rfc6749#section-2.3
  40. * @see https://github.com/bshaffer/oauth2-server-php/issues/257
  41. *
  42. * @ingroup oauth2_section_2
  43. */
  44. public function isPublicClient($client_id);
  45. }