[6351] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * Storage engines that support the "Resource Owner Password Credentials" |
---|
| 5 | * grant type should implement this interface |
---|
| 6 | * |
---|
| 7 | * @author Dave Rochwerger <catch.dave@gmail.com> |
---|
| 8 | * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.3 |
---|
| 9 | */ |
---|
| 10 | interface IOAuth2GrantUser extends IOAuth2Storage { |
---|
| 11 | |
---|
| 12 | /** |
---|
| 13 | * Grant access tokens for basic user credentials. |
---|
| 14 | * |
---|
| 15 | * Check the supplied username and password for validity. |
---|
| 16 | * |
---|
| 17 | * You can also use the $client_id param to do any checks required based |
---|
| 18 | * on a client, if you need that. |
---|
| 19 | * |
---|
| 20 | * Required for OAuth2::GRANT_TYPE_USER_CREDENTIALS. |
---|
| 21 | * |
---|
| 22 | * @param $client_id |
---|
| 23 | * Client identifier to be check with. |
---|
| 24 | * @param $username |
---|
| 25 | * Username to be check with. |
---|
| 26 | * @param $password |
---|
| 27 | * Password to be check with. |
---|
| 28 | * |
---|
| 29 | * @return |
---|
| 30 | * TRUE if the username and password are valid, and FALSE if it isn't. |
---|
| 31 | * Moreover, if the username and password are valid, and you want to |
---|
| 32 | * verify the scope of a user's access, return an associative array |
---|
| 33 | * with the scope values as below. We'll check the scope you provide |
---|
| 34 | * against the requested scope before providing an access token: |
---|
| 35 | * @code |
---|
| 36 | * return array( |
---|
| 37 | * 'scope' => <stored scope values (space-separated string)>, |
---|
| 38 | * ); |
---|
| 39 | * @endcode |
---|
| 40 | * |
---|
| 41 | * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.3 |
---|
| 42 | * |
---|
| 43 | * @ingroup oauth2_section_4 |
---|
| 44 | */ |
---|
| 45 | public function checkUserCredentials($client_id, $username, $password); |
---|
| 46 | } |
---|